I don't understand the double quotes when I run the following command in a process
"C: \ Program Files \ gs \ gs9.52 \ bin \ gswin64c" -r300 -dNOPAUSE -dBATCH -sDEVICE = mswinpr2 -sOutputFile = "% printer% NEC MultiWriter8450N NPDL" "d: \ Cy_D_Cyuumon_M_Cyuumon (9) .pdf"
// Create a Process object
System.Diagnostics.Process p = new System.Diagnostics.Process ();
// specify the file to start
p.StartInfo.FileName = @ "C: \ Program Files \ gs \ gs9.52 \ bin \ gswin64c";
p.StartInfo.Arguments = "-r300 -dNOPAUSE -dBATCH -sDEVICE = mswinpr2 -sOutputFile =% printer% NEC MultiWriter8450N NPDL";
p.StartInfo.Arguments = @ "d: \ Cy_D_Cyuumon_M_Cyuumon (9) .pdf";
  • Answer # 1


    Double quotation processing in process start argument

    I think that if you enclose it with double quotes like "% printer% NEC MultiWriter8450N NPDL" or "d: \ Cy_D_Cyuumon_M_Cyuumon (9) .pdf", even if there is a space between them, it will be acquired as one argument. ?


    If you heard about the command "C: \ Program Files \ gs \ gs9.52 \ bin \ gswin64c" instead of an argument, it means that it will be recognized as a single command by enclosing it in double quotes. think. (Try it out without trial. The white space in Program Files)

  • Answer # 2

    Now that I understand how to use double quotes in a command, I will end.