问题
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.
回答1:
Create a ProcessStartInfo
, set its WorkingDirectory
and use Process.Start(processStartInfo);
回答2:
No alternative to process.start
but an alternative to your code
Process.Start("cmd.exe","iw4sp.exe");
来源:https://stackoverflow.com/questions/12165125/alternatives-to-system-diagnostics-process-start