Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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%.

Console Window

Checking the environment variables window shows that it is defined.

Environment Varibales

Checking the registry also shows that it is defined as well. I've actually deleted the key and re-entered it to no avail.

Registry

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.

share|improve this question
    
try to use set to assign value to windir manually and repeat with echo 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 Jan 3 '13 at 19:41
    
Setting 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 Jan 3 '13 at 19:50
    
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 Jan 3 '13 at 21:04
    
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 Jan 3 '13 at 21:50
    
I see you have programming related ENV variables in the screencaps. Do you have a really long PATH variable? –  horatio Jan 4 '13 at 19:35

4 Answers 4

With the GUI, set your %windir% variable content to %SystemRoot%.

As for your %path%, you may solve this with Registry Editor:

  • Start Regedit.exe
  • Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
  • In the right pane, double-click on the value Path (REG_EXPAND_SZ)
  • Change the value however you like and reboot

enter image description here

share|improve this answer
    
This looks like it fixed it. I'll give it a full day at work on Monday to make sure, and assuming all goes well, I'll mark this as the correct answer after that. Thanks. –  Zack Jan 5 '13 at 22:25
1  
@Zack I have the exact same problem on a lenovo T430 and so does a coworker. The above answer did not work. Was the problem eventually solved? –  inquisitiveIdiot Oct 23 '13 at 18:18
    
@inquisitiveIdiot - I never fully resolved it. I uninstalled some stuff that was in the path and kept pruning the path down manually at the command line. Eventually the problem stopped happening. –  Zack Nov 12 '13 at 19:21
    
@Zack I just posted what ended up working as an answer in case you have a problem again –  inquisitiveIdiot Nov 12 '13 at 19:29
    
Having the same problem on a T430 also. –  Lightyear Buzz Jul 14 at 2:00

Our help desk gave me this response:

  1. Open User Account Control Settings by clicking the Start button , and then clicking Control Panel. In the search box, type uac, and then click Change User Account Control settings.
  2. Do the following: •To turn off UAC, move the slider to the Never notify position, and then click OK. If you're prompted for an administrator password or confirmation, type the password or provide confirmation. You will need to restart your computer for UAC to be turned off.

It works given two different things:

1.) This problem doesn't actually exist because this program requires %windir to be correctly working. Instead run C:\Windows\System32\UserAccountControlSettings in command prompt.

2.) You prefer not having the windows security warnings.

share|improve this answer
    
UAC was already disabled in my case, but if this works for you or anyone else, that's great –  Zack Nov 12 '13 at 20:37

I did have the same problem in my Lenovo TS530. It started to occur after installing new programs that caused my path to be even much longer than before and so that the installers added the new stuff into the beginning of path definition. I edited the path in regedt by moving %SystemRoot% into the beginning of the path definition.

path = %SystemRoot%\system32;%SystemRoot%;%SystemRoot....

In addition, I edited enviromental variable windir from

windir= C:/Windows

to

windir=C:\Windows

That seems to have fixed the problem. (It is possible that I did the mistake with backslash earlier while trying to fix the problem. Or alternatively the installer has changed it.)

share|improve this answer

I had the same issue and found this question first. However, the real cause/solution is not mentioned yet in this question, but it is mentioned here: Windows 7's PATH and environment variables are corrupted

Summary of the solution: make sure your path is < 2048 characters. Check in both the user variables and the system variables.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.