Trying to use the code below to use writeline to create a batch file. However it seems that the third line won't run in a batch file due to the spaces in the file path. I have tried to enclose in "" "" but that creates 6 new errors. Thanks I am new to this just trying to make some sense. After searching the web the just can't seem to find a solution.
StreamWriter w = new StreamWriter(@"C:\temp\InstallAgent.bat");
w.WriteLine("C:\\temp\\framepkg.exe /install=agent /silent");
w.WriteLine("C:\\PRogram Files\\McAfee\\Common Framework\\cmdagent.exe /p");
w.Close();
You need to escape the extra quotes with \"
"\"C:\\Program Files\\McAfee\\Common Framework\\cmdagent.exe\" /p");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With