Alternatives to System.Diagnostics.Process.Start()

天大地大妈咪最大 提交于 2019-12-13 10:26:52

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!