Jump to content

Changing/updating environment vars in Visual Studio?


Masterxilo
 Share

Recommended Posts

I recently installed the latest windows sdk (7.0).

But the environment variable/"macro" $(WindowsSdkDir) from msvc still points to the old location ("C:\Program Files\Microsoft SDKs\Windows\v6.1\" instead of "C:\Program Files\Microsoft SDKs\Windows\v7.0\").

 

I executed all

  • C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat,
  • C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat and
  • C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat (I think this should be the only one that has to be run.)

with admin privileges.

From what I know, these should update the variable from the registry "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder", where the correct current install folder is stored (I checked).

 

But even after running these the WindowsSdkDir variable still points to the old location.

 

Any ideas?

Link to comment
Share on other sites

Yes I know I could manually ad the new folder and delete the old one, but I want to use the variable.

 

Nvm. I found and solved the problem.

For some reason the variable updating batch file looks up the vars at HKCU (looks like it's not allowed to read from HKLM), but the installation only updated the values in HKLM. I copied those over and it works fine now.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...