1

When I run cmd.exe and type 'set' I have a %LIB% variable set. The value is pointing to a folder that doesn't exist, which causes warnings during Visual Studio compiles.

Here's the thing... If I go to System Properties->Advanced->Environment Variables it's not set in either User Variables or System Variables. It's also not set in my C:\Autoexec.bat.

Swoogan
  • 2,087
  • 1
  • 14
  • 21

3 Answers3

2

Microsoft's Command Shell Overview gives a detailed description of where/how variables are stored.

The punchline is that User vars are stored in HKCU\Environment, and System vars are in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment.

gWaldo
  • 11,957
  • 8
  • 42
  • 69
  • Thank you, but I've already read that document and looked in those registry keys. They contain the same values that "System Properties->Advanced->Environment Variables" contain. Which is to say, they don't contain my %LIB% var. Where else might it be set? – Swoogan Nov 01 '10 at 18:03
  • OK, do you have a login script, which that document also lists? How about autoexec.bat and any other startup scripts? – mfinni Nov 01 '10 at 18:14
  • I can't find where it's set (other than "it's set by an old version of Visual Studio"), but you can use the set command to change the EnvVar to another path. – gWaldo Nov 01 '10 at 18:17
1

Not sure where it was set from, but I was able to get rid of it by setting it in System Properties->Advanced->Environment Variables to "c:\". I then could select it from the list and click delete. Afterward it was gone from my command prompt.

Swoogan
  • 2,087
  • 1
  • 14
  • 21
0

If you run VS command prompt, you should be able to see LIB env there, I suppose. So the way you set this variable is primarily via visual studio. Go to Tools and click Options to get the window. There, find 'project and solutions' and click VC++ Directories if you work with C++. Then on the right hand side, you should see the menu 'Show directories for:' and when you click that button, you will see Library files. That is one of the places where you can specify your library path. HTH.

istudy0
  • 221
  • 1
  • 1
  • This really has nothing to do with VS, the VS command prompt, and definitely not C++. When I run cmd.exe it's there. Where can I "unset" it? – Swoogan Nov 01 '10 at 17:27