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
VB script to uninstall with admin rights.
Can't print to Dymo Labelwriter 400 turbo after adding labelwriter 450 turbo drivers on windows 2003 terminal server
Test javamail through command line
In .NET, how can I add to a variable value to a query result using LINQ to SQL?
Boot Acer Ferrari 1200 laptop from dvd to upgrade vista to windows 7
Javascript form validation problems
Dynamically Change .XSD File Location in Crystal Reports Using ASP.NET 2.0
Project Server 2010 won't install
Reset of displayed form when "requery" is performed
Spanning-tree Cost to block uplink to core Switches.