I’ve had a fellow team member who had the following error message raised when VS.NET 7.1 was trying to run the post-build event batch file:
'PostBuildEvent.bat' is not recognized as an internal or external command, operable program or batch file.
This has happened to several people before her.
I worked on this for a while and came to the conclusion that the answer is that your registry has a key named HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor which contains a string value named AutoRun.
This value indicates what any instance of cmd.exe should run in it at start. This value changed the current directory to the C: root.
I cleared the value and the problem was solved.
Taking advantage of my new-found knowledge, I placed “C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat” as the value, so that any cmd.exe instance would have be a VS.NET instance.