-1

For some unknown reasons, An Executable (iw4sp.exe executable for Call of duty modern warfare 2) runs normally when launched from explorer but crashes when launched by Process.Start() in my application. Any alternatives to Process.Start?? i tried starting explorer by passing iw4sp as argument, but same thing happens. Application exited with a code that a file was missing (i double checked that file exists.) same error was faced when i created . *.url shortcut to exe and ran from explorer.

Umar Hassan
  • 192
  • 3
  • 11
  • 1
    does the properties of the shortcut have any start in directory? – Daniel A. White Aug 28 '12 at 18:17
  • Can you show us your code? Also, try setting the working directory: http://stackoverflow.com/questions/114928/net-process-start-default-directory – RQDQ Aug 28 '12 at 18:20

2 Answers2

4

Create a ProcessStartInfo, set its WorkingDirectory and use Process.Start(processStartInfo);

L.B
  • 114,136
  • 19
  • 178
  • 224
2

No alternative to process.start but an alternative to your code

Process.Start("cmd.exe","iw4sp.exe");
perilbrain
  • 7,961
  • 2
  • 27
  • 35