-1

How can I start a program in the following way?

"C:\Users\Administrator\Downloads\exe1.exe" 13\10\2018 00:00:00 "C:\Program Files (x86)\Folder\exe2.exe" 

I tried this way, but it did not work and an exception was thrown

Process.Start("\"C:\\Users\\Administrator\\Downloads\\exe1.exe\" 13\\10\\2018 00:00:00 \"C:\\Program Files (x86)\\Folder\\exe2.exe\"")
Vladel
  • 230
  • 1
  • 4
  • 16

2 Answers2

0

You may use the Process.Start(fileName, arguments) method.

kaffekopp
  • 2,551
  • 6
  • 13
0

Two Things are wrong here:

  1. You can't include parameters in the Process.Start(filename) method. You need to use Process.Start(filename, parameters) method.

  2. Don't escape the double quotes, in fact its' a normal string, so skip those double quotes.

You method can be called like this:

Process.Start("C:\\Users\\Administrator\\Downloads\\exe1.exe",  "C:\\Program Files (x86)\\Folder\\exe2.exe");
Poul Bak
  • 10,450
  • 5
  • 32
  • 57