Anthony Gags

Anthony Gags

  • NA
  • 11
  • 1.7k

calling a string variable in "proc.StartInfo.Arguments" Pin

May 29 2017 2:13 AM
Hi all,
i have declared a string below which will be a switch to a command.

string prnportpatha=@"\\servername\apps\Utilities\AddPrinter\prnport.vbs";

how do i call the variable in a command as per below


proc.StartInfo.FileName=("cmd.exe");
proc.StartInfo.Arguments=("/k cscript " + prnportpatha);


this doesnt seem to work, i get the error:
the name prnportpatha does not exist inthe current context.

Answers (1)