Execute a *.bat file in C# project
-
Hi all, On the release mode only, when build the project I want to execute a bat file. That bat file do another process. What I've try is add the bat file name as the command argument in project property as pre-build event command line. But it not works for me. Can anyone comments on this. Thanks you.
I appreciate your help all the time... CodingLover :)
-
Hi all, On the release mode only, when build the project I want to execute a bat file. That bat file do another process. What I've try is add the bat file name as the command argument in project property as pre-build event command line. But it not works for me. Can anyone comments on this. Thanks you.
I appreciate your help all the time... CodingLover :)
May be this works, because author is executing bat file in this article using post build event. http://www.highoncoding.com/Articles/398_Using%20Post-Build%20Event%20to%20Execute%20Unit%20Tests.aspx[^]
-
Hi all, On the release mode only, when build the project I want to execute a bat file. That bat file do another process. What I've try is add the bat file name as the command argument in project property as pre-build event command line. But it not works for me. Can anyone comments on this. Thanks you.
I appreciate your help all the time... CodingLover :)
-
Actually I don;t want to run the project. Only in the build, compile, I want to run the .bat file. I've set the properties on post-build event command line as follows.
call $(ProjectDir)build_help.bat
It calls the bat file correctly. But it's not execute. bat content like this.echo compiling help documentation "C:\Program Files\HTML Help Workshop\hhc.exe" Help.hhp echo done.
error is,Unable to open Help.hhp
But when I double click on the bat file it works fine.I appreciate your help all the time... CodingLover :)
-
Actually I don;t want to run the project. Only in the build, compile, I want to run the .bat file. I've set the properties on post-build event command line as follows.
call $(ProjectDir)build_help.bat
It calls the bat file correctly. But it's not execute. bat content like this.echo compiling help documentation "C:\Program Files\HTML Help Workshop\hhc.exe" Help.hhp echo done.
error is,Unable to open Help.hhp
But when I double click on the bat file it works fine.I appreciate your help all the time... CodingLover :)
-
Try specifying the file path for "Help.hhp", absolute path or place "Help.php" in the release/debug folder(whichever you are currently building on)
Seems it's fine. But now the case is I've to place all html files and stuff in bin folder too.
I appreciate your help all the time... CodingLover :)
-
Seems it's fine. But now the case is I've to place all html files and stuff in bin folder too.
I appreciate your help all the time... CodingLover :)
-
You can copy then back to where you want with a batch file :-D Did it not work with an absolute path ?
As I said earlier once the command is
call $(ProjectDir)build_help.bat
ask to add bat file into the bin folder. If I added bat file into the bin, I have to change all paths.I appreciate your help all the time... CodingLover :)