Microsoft
Software
Hardware
Network
Question : How to format Process.StartInfo.Arguments with spaces in the arguments?
hi,
I am trying to invoke an ftp command from my C# application using a Process.
I have the below code in my program.
I have spaces in the first argument of the Process and it is acting weird and not formatting properly.
scriptfile = "C:\Program files\PR Ent\AddIns\PR Bridge\Upload\UploadScript
.txt";
s.Filename = "File1";
Process P = new Process();
P.EnableRaisingEvents = true;
P.Exited += P_Exited;
P.StartInfo.FileName = filename;
P.StartInfo.Arguments = scriptfile + s.Filename;
P.Start();
Could anybody please help me how to format properly when having spaces?
Thank you.
Answer : How to format Process.StartInfo.Arguments with spaces in the arguments?
try
P.StartInfo.Arguments = scriptfile + s.Filename;
-->
P.StartInfo.Arguments = "\"" + scriptfile +"\" "+ s.Filename;
Random Solutions
ORACLE SQL similarity with SQL Server
Installing multiple operating systems from the same usb drive.
getting an format error using to_char function
keep same server name after exchagne transition
Monitor temperature switch
MISC HP 512MB P-SERIES BBWC UPGRADE - 462967-B21
Windows Service crashing on one machine, not on the other
how to use CFCONTENT to deliver files from a folder outside web root, to a web browser? and loop through a series of fileIDs associated with a DocumentID
unable to scan with my HP Photosmart All-in-one printer
How can I find out what type of driver I need for a "other device, Unknown Device" for a nc6400 laptop