Passing variables to Process
Posted on 2014-12-22
I am passing some parameters to cmd.exe using System.Diagnostics.Process. Parts of the parameters are paths that contain spaces, but I solve that using this syntacs:
string tmpFullPath = @"""C:\My Data\""" + doc + @".xls";
This works fine, but I run into problems if the doc variable contains a filename with spaces.
Can someone please give me the syntacs for how to ‘hide’ the spaces in the doc variables value so that it will work the same way inside the example above?