So I am trying to launch a printer script using cscript from C#, and cscript launches a visual basic file. So sort of a daisy chain (and I want to keep this daisy chain intact for certain reasons).
Here's the code:
Process.Start("c:/windows/system32/cscript.exe c:/windows/System32/Printing_Admin_Scripts/en-US/prnport.vbs");
Now, when I launch ONLY cscript, no problems.
However when I add the condition of prnport.vbs to the cscript launch, I get this error in Visual Studio:
"The system cannot find the file specified"
But I can confirm the file path is correct - prnport.vbs
DOES exist in /en-US
.
So what am I doing wrong here? Can you not pass arguments (and in this case, the file path is being passed as an argument to cscript.exe) when using Process.Start?
New to C# and confused about the proper way to do this.