45
8
See Updates 3 and 4 below for how the issue has evolved
My computer (Windows 7 x64, Lenovo Thinkpad T530) is having an issue resolving %windir%. After boot-up, everything works fine. At some point a while later, the computer is suddenly unable to resolve %windir%.
Checking the environment variables window shows that it is defined.
Checking the registry also shows that it is defined as well. I've actually deleted the key and re-entered it to no avail.
After a reboot, everything works fine for a while. Does anyone have any thoughts on anything else I can check?
Update 1: After thinking about it some, I have uninstalled the Konica Minolta Pagebox driver/program that was installed about the time this problem started happening (see comments below). The problem seems to take about 4-24 hours (I've never timed it) to manifest, so I'll update again after that.
Update 2: Issue is still occurring. I came back from lunch and %windir% cannot be found. I did a test after a reboot this morning and put the computer to sleep, then woke it up. %windir% was still defined after waking up.
Update 3:
Per Daniel in the comments, I ran set
before and after error and compared the outputs. The first thing I noticed is that on a fresh boot my %path% is 2000+ characters long. I pruned it down to ~375 characters and verified it in a new cmd window. I rebooted, checked the path again, and it was back to over 2000+ characters (it matched what I originally saw). I truncated it again and rebooted once more and the same thing happened. I deleted the path variable and created a new one; same thing happened. At this point all I can conclude is either I cannot permanently change my path OR the path is being reset by some process on boot. Any thoughts?
Update 4:
I edited my path via the registry method suggested below. I checked my path today after running for a while and it has grown from what I entered into the registry; it now has a few new entries and a lot of duplicates. The only new entries are from SQL Server 2012. I went to change this in the registry and I noticed that the registry does NOT match the output of echo %path%
. Checking the Environment Variables from the Advanced Properties Tab shows a third version of my path.
Registry Path:
C:\Program Files (x86)\Microchip\mplabc30\v3.30\bin;
C:\RUBY193\BIN;
C:\Windows\SYSTEM32;
C:\Windows;
C:\Windows\SYSTEM32\WBEM;
C:\PROGRAM FILES\COMMON FILES\LENOVO;
C:\SWTOOLS\READYAPPS;
C:\PROGRAM FILES (X86)\COMMON FILES\LENOVO;
C:\PROGRAM FILES (X86)\MICROCHIP\MPLAB C32 SUITE\BIN;
C:\HTSOFT\PIC18\BIN;
C:\PROGRAM FILES\TORTOISESVN\BIN;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;
Command Line path:
C:\Program Files (x86)\Microchip\mplabc30\v3.30\bin;
C:\RUBY193\BIN;
C:\Windows\SYSTEM32;
C:\Windows;
C:\Windows\SYSTEM32\WBEM;
C:\PROGRAM FILES\COMMON FILES\LENOVO;
C:\SWTOOLS\READYAPPS;
C:\PROGRAM FILES (X86)\COMMON FILES\LENOVO;
C:\PROGRAM FILES (X86)\MICROCHIP\MPLAB C32 SUITE\BIN;
C:\HTSOFT\PIC18\BIN;
C:\PROGRAM FILES\TORTOISESVN\BIN;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;
C:\Program Files(x86)\Microchip\mplabc30\v3.30\bin;
C:\RUBY193\BIN;
C:\Windows\SYSTEM32;
C:\Windows;
C:\Windows\SYSTEM32\WBEM;
C:\PROGRAM FILES\COMMON FILES\LENOVO;
C:\SWTOOLS\READYAPPS;
C:\PROGRAM FILES (X86)\COMMON FILES\LENOVO;
C:\PROGRAM FILES (X86)\MICROCHIP\MPLAB C32 SUITE\BIN;
C:\HTSOFT\PIC18\BIN;
C:\PROGRAM FILES\TORTOISESVN\BIN;
C:\Windows\System32\WindowsPowerShell\v1.0\;
Environment Variables path:
C:\Program Files (x86)\Microchip\mplabc30\v3.30\bin;
C:\RUBY193\BIN;
C:\Windows\SYSTEM32;
C:\Windows;
C:\Windows\SYSTEM32\WBEM;
C:\PROGRAM FILES\COMMON FILES\LENOVO;
C:\SWTOOLS\READYAPPS;
C:\PROGRAM FILES (X86)\COMMON FILES\LENOVO;
C:\PROGRAM FILES (X86)\MICROCHIP\MPLAB C32 SUITE\BIN;
C:\HTSOFT\PIC18\BIN;
C:\PROGRAM FILES\TORTOISESVN\BIN;
C:\Windows\System32\WindowsPowerShell\v1.0\;
It looks as though the command line path = registry path + environment variables path. I attempted to set the registry path and the environment variables path to the same thing and reboot. After reboot, my path is now doubled, basically two back-to-back copies of the registry path above.
Once again, any thoughts?
Update 5: After talking with the IT Manager, he says he is fighting a similar issue on another computer. Both computers have SSDs (seems to be the only common factor). This may or may not be pertinent.
I had a similar problem and cutting down on items in the path solved it for me. – M-Peror – 2014-08-26T15:59:46.557
1
Possible duplicate of Windows 7's PATH and environment variables are corrupted
– jpaugh – 2017-07-28T20:22:08.293try to use
set
to assign value towindir
manually and repeat withecho
again - see if this will give you output or not. If it will then something is messing up with your env variables - if not then something is not ok with your shell and/or echo command. – mnmnc – 2013-01-03T19:41:36.050Setting it works, but I'm not really sure that that proves anything, as I can run "set SystemRoot=abcd", for a similar, short-lived session variable – Zack – 2013-01-03T19:50:23.480
If I may ask, how did you notice this in the first place? That is to say, what tipped you off that there was a problem? (On the off chance that it's relevant...) – Shinrai – 2013-01-03T21:04:51.577
Some couple of weeks ago, a network scanner driver was installed on my computer. Shortly thereafter, I had issues with windows programs not being found. I tracked it down to my path being too long, and fixed it. This may or may not be related. Things have been quirky since. Specifically, the windows speaker icon in the bottom corner raises an error periodically ("No output driver found", but the sound still works). I went to check the path again, and I got an error trying to get to advanced system settings ("cannot find %windir%\system32..."). I tracked it down to windir not resolving. – Zack – 2013-01-03T21:50:45.993
I see you have programming related ENV variables in the screencaps. Do you have a really long PATH variable? – horatio – 2013-01-04T19:35:57.500
Try typing "set" in a command prompt before this happens & save the result. Then compare to what you get after, to see if any other vars are getting stomped. – Daniel R Hicks – 2013-01-04T19:58:46.190
My path is currently 722 characters long (After the scanner driver was installed path was about 1100 chars long; I trimmed it down) – Zack – 2013-01-04T20:38:21.037
Daniel - I will try that and update when I have a result (probably on monday; this is on work computer) – Zack – 2013-01-04T20:42:53.757