How to find and delete a system variable that's not in the registry or listed in "system environment variables"

0

Restarting my machine and opening an admin console and executing:

echo %LIB%

outputs:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\lib\x86;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\lib\um\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x86;

The issue is LIB isn't in the registry nor in my system environment variables. Just to be sure I also ran the reg delete commands:

reg delete "HKCU\Environment" /v /f LIB
ERROR: The system was unable to find the specified registry key or value.
reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v LIB
ERROR: The system was unable to find the specified registry key or value.

No effect. It's like this "LIB" system environment variable exists beyond the registry (searching the registry says the string doesn't exist anywhere there).

If I use setx /m to set the variable it shows up in the registry and system environment variables with my value, but when I echo %LIB% it shows my new value simply appended to the end. I don't know what Visual Studio 2019 could have set that created this. How do I find the source of this variable and delete it?

Sirisian

Posted 2019-09-18T01:44:29.370

Reputation: 101

What problem are you trying to solve exactly? – Ramhound – 2019-09-18T03:54:23.543

No answers