views:

319

answers:

1

I have inherited a visual studio 2003 project which uses some custom build steps. I'm having some trouble with the path to the tool. Where does visual studio get its PATH? I've echoed out %PATH% in the custom build step and it has no resemblance to the system path. I did find a value in the registry

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories

Path Dirs which looked like it might be the path used by visual C but chaning it doesn't seem to alter the path in VC. Any ideas?

A: 

Visual Studio has the annoying habit of 'playing' with your path, which leads to the effect you've seen.

The easiest way to work around it if you're willing to change the environment inside VS (which will change it for all your projects) would be to go to Tools > Options > Projects > VC++ Directories and add the required directories to the appropriate setting - in your case that should be 'Executable files'.

Another method I am using if I don't want to change the overall environment is to create a batch file that first calls vsvars32.bat for the appropriate compiler version, then manipulate the PATH variable and finally starts 'devenv'. I actually prefer this approach but it means your disk is littered with small batch files that you'll only use to kick off Visual Studio...

Timo Geusch