Fer 26 Posted October 4, 2015 Report Share Posted October 4, 2015 So I am having issues keeping the spaces in a shell command. string location = parameters["location"]; System.Diagnostics.Process.Start("CMD.exe", ("/C" + @location + " /connect")); Every time I run the command it says that it cannot find a specific path which usually ends on "C:/Program" (assuming it is not using the spaces)I read a lot on google about this but nothing seems to work. They recommend adding a "@" before the string of text but I'm using a string name instead of just plain words. (like /connect) Any ideas? Got it System.Diagnostics.Process.Start("CMD.exe", "/C \"" + @location + "\" /connect"); Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.