views:

204

answers:

2

I'm using a script to get the subversion head revision number from a subversion repository derived from the script found at http://blog.guymahieu.com/2008/06/09/getting-the-svn-head-revision-number-from-a-windows-batch-file/. The script works fine when called from a normal command line, but when calling the same batch file as pre-build-event with path $(ProjectDir)/../getSVNRev.bat the command svn is unknown.

The path to svn.exe is in the standard system %Path% but it seems that VS uses another path. I echoed the %Path% variable in the batch file and the %Path% seems to be set to the VC++ binary path. I added the path to svn.exe to the VC++ binary path, got that echoed, but still the svn.exe was not found.

I even copied svn.exe and all dlls into system32 but still, the command svn was unknown to the VS command line.

Are there any other locations I should add the path, so that the pre-build event on VS.NET 2003 recognizes svn.exe?

Thanks, Norbert

+1  A: 

I think you want to go to Tools->Options->Projects and Solutions->VC++ Directories, then make sure that "Show directories for" is set to "Exectuable Files" and your platform is set to Win32, then add the directory with the executable to the list, or just add $(Path) to the list so that your system paths end up in there.

arolson101
A: 

I forgot that this was still online and unsolved. As arolson101 suggested (and I mentioned before), the path variable in question is set in VC++ binary/executable path. I can't recollect what the error was, but I managed to fix it and the svn is now working as expected in the script.

Anyway thanks for your suggestions arolson101.