cmd /c and
cmd /k always treat
& as the separator between multiple commands. You are telling it to start the URL up to "srn=216", and then run the command
orderid=42, which won't be recognized.
It won't understand HTML encoding, so using
& will simply tell it to start the URL up to "srn=216", and then run the command
amp, which also won't be recognized.
If you use the URL-encoded value
%26, the full URL will be executed. But it won't be the URL you need: instead of passing two query-string parameters,
orderid=42, you'll be passing a single parameter -
src=216%26orderid=42. On the server, the
src parameter will be equal to
To escape the URL properly, you would need to prefix the
^, and surround the URL with quotes:
string url = "...?srn=216^&" + _ebayOrder.OrderNumber;
var psi = new ProcessStartInfo()
FileName = "cmd",
WindowStyle = ProcessWindowStyle.Hidden,
UseShellExecute = false,
CreateNoWindow = true,
Arguments= "/c start \"" + url + "\"",
Process.Start(psi); But, as Dave said, you don't need to do that. Just execute the URL directly:
string url = "....?srn=216&" + _ebayOrder.OrderNumber;
Process.Start(url); This will use the
ShellExecute function, which will launch the user's default browser and navigate to the URL.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."