Process.Start, WorkingDirectory, start one exe from another

后端 未结 1 1333
别跟我提以往
别跟我提以往 2021-01-26 13:02

I hope you will get my problem, dont know if I can describe it properly in english, but I will try :)

Situation:

  • Folder Structure: MainFolder/Sub1/Sub2
相关标签:
1条回答
  • 2021-01-26 13:52

    That SecondProg.exe apparently looks in its working directory for that file and fails if it doesn't find it. As such, you have to set the working directory of the new process. To do that, create a ProcessStartInfo object, set the FileName to the path of the EXE file and the WorkingDirectory to the path of the folder containing that EXE. You then pass that object as an argument when you call Process.Start.

    0 讨论(0)
提交回复
热议问题