开发者

How to run an exe on a post build event

开发者 https://www.devze.com 2023-04-12 06:38 出处:网络
What is the correct script to run a certain exe 开发者_如何转开发file on a post build event?Just as you would run this .exe from command-line. So, specify your .exe with full path and enclose it in do

What is the correct script to run a certain exe 开发者_如何转开发file on a post build event?


Just as you would run this .exe from command-line. So, specify your .exe with full path and enclose it in double-quotes if either path or executable name contain spaces.


Provided answer is correct, however providing the full path is not always necessary.

Example: run one of the projects output executable.

  • (optionally) Configure post-build event to run Always
  • use a path relative to the project path. E.g.: "$(ProjectDir)bin\Debug\maybe_just_refreshed.exe" or better version suggested by m93a: "$(TargetDir)maybe_just_refreshed.exe" (this compansates for the cases when output location is customized (not the default bin\Debug).


None of these answers worked for me.

Even though my exe was at the file path I provided, it still exited with a code of "whatever" and never worked.

Then I did this:

cd $(ProjectDir)

"MyProgram.exe"

...both on separate lines in the post build event command line editor.

My app is located in the project directory. They didn't work on the same line, but separate lines worked fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消