The @
character is a special quoted string so it behaves differently than a standard string. Essentially what was happening is the process was being started with what would look like this from the command line:
> Helpdesk-02.exe "/department it"
Or one argument. Removing the @
symbol forces C# to interpret the string as expected:
> Helpdesk-02.exe /department it
A subtle, but critical difference.
The @
operator was designed to make it easier to work with paths that have embedded spaces, backslashes, and other characters that have to be escaped in standard strings. Essentially, it does the character escaping for you. The two declarations are equivalent:
string pathToExplorer = @"C:\Program Files\Internet Explorer\iexplore.exe";
string escaped = "\"C:\\Program Files\\Internet Explorer\\iexplore.exe\"";
It's best to only use the @
operator when you are working with paths to files, and use the normal way when dealing with the parameters.