I\'m trying to execute a batch file during a pre-build event. I have a new project and have added foo.bat to it. The file contains the following line:
It's possible that you have another foo.bat
somewhere in the PATH
. Try to specify full path to your batch file like C:\Path\to\foo.bat
.
When project is being built the current directory is the one with the .vcproj
file. The command path should be specified relative to this directory, if it's not in the PATH
.
One more thing to try to diagnose the problem would be to specify cmd
in the pre-build event command explicitly like this:
cmd /c C:\Path\to\foo.bat
or even
C:\windows\system32\cmd.exe /c C:\Path\to\foo.bat