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
C++ uninitialized local variable
What does src="#" mean when used in a bgsound attribute and is it needed?
Strip off double quotes from string and replace with single quote
SQL in C# code .. Reading Output Parameters.
Configuring Exchange 2010 to receive emails for other domains
importing a date field from oracle into MSSQL
Outlook 2003 - remove mail on server after copied to OST
454 5.7.3 Client does not have permission to submit mail to this server
Airport Code with reverse geo coding with google maps api
creating user defined services on windows 7