As with most things, this is actually stored in the registry. Take a look at the HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\Version\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories key. You may need to restart the environment (the IDE) after changing that, however. To access this programmatically, if you look in the MSDN Online Library[^] you will find the VCPlatform object, which exposes those directories as properties. This is not in the EnvDTE.dll assembly, however. You must reference Microsoft.VisualStudio.VCProjectEngine.dll. IIRC, you should be able to cast (performs a QueryInterface on the COM component) from a Project object defined in the EnvDTE.dll assembly.
Software Design Engineer Developer Division Sustained Engineering, Microsoft My Articles