Cannot resolve %windir%
I faced once strange problem that somehow system environment variable %windir% could not be resolved.
This means that all shortcuts that are pointing to C:\Windows\System32 will not work.
You will not be able to set it directly by clicking with right mouse button on Computer icon and you will get this message
To solve this just open this directly from Start > Run… and set this environment variable
c:\Windows\System32\systempropertiesadvanced.exe
In my case %windir% was pointing to undefined %SystemRoot% so I just added it and make it point to C:\Windows
This didn’t helped. After the research I found out that length of my %PATH% variable was more then 2048 chars.
It must be bellow 2048 chars and when I deleted non-important paths it started working OK!
Conclusion:
Keep your system variables less then 204 chars in length!