%WINDIR% not working

rowanbradley

New member
Member
Local time
5:19 AM
Messages
49
For the last two days something has got corrupted in my system (Windows 7 Pro 64 bit).
All of the shortcuts to Notepad, Paint, Explorer etc. in my Quick Start bar have lost their icons. When I click these icons I get the message:
[Window Title]
Windows
[Main Instruction]
Can't open this item
Contents

It might have been moved, renamed, or deleted. Do you want to remove this item?
[Yes] [No]
I can still run these components by typing their name in the Search box in the Start menu, or by going to find them in the C:\Windows\System32 directory and double clicking them.
These shortcuts are set to %WINDIR%\System32\notepad.exe. The problem seems to be with the value of %WINDIR%. If I change the shortcut to C:\WINDOWS\SYSTEM32\notepad.exe then it works fine.
If I run SystemPropertiesAdvanced.exe, I can see the value of WINDIR is set to C:\Windows.
If in a command window I type "ping 192.168.0.7" (without the quotes), it says "'ping' is not recognized as an internal or external command, operable program or batch file." I imagine this is due to the same basic cause.
What is going on here? How can I diagnose and correct this?
I have tried doing a system restore back to a time when my PC was working properly. It made no difference to this problem.

Thanks - Rowan
 

My Computer

OS
Windows 7 Pro
Do you have a Restore Point prior to the error? It looks like something has caused you to lose one or more environment variables. A restore point would be the simplest fix. If you don't have one then they will need to be set by hand.

Edit: for backing up the Registry ERUNT is handy.
 

My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Thanks for your suggestions.

I have already restored to a restore point before which I'm pretty sure the system was working correctly. It didn't fix the problem.

Also, loss of environment variables does not seem to explain the symptoms. If I run c:\windows\system32\SystemPropertiesAdvanced.exe (which I have to do explicitly, since the shortcuts to it use %WINDIR%), it tells me that WINDIR is set to C:\Windows, which is surely correct. Also PATH and other likely environment variables seem to be set to sensible things. But if in a CMD window I say set windir, it says "Environment variable windir not defined". If I say echo %WINDIR%, it says %WINDIR%.

So it's not apparently that the environment variable has lost its value (otherwise why is SystemPropertiesAdvanced showing it to me correctly? It's like it's lost its ability t0 retrieve the value (except for SystemPropertiesAdvanced).

Thanks - Rowan
 

My Computer

OS
Windows 7 Pro
Try this. Open a command prompt and type set and hit <Enter>

Open an Elevated command prompt and do the same thing. From what you say, variables shown in the Admin command window should be missing in the normal user command window.
 

My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Indeed do #4 . Post screenshot of the output
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
I have discovered that, as someone suggested in a related thread, if I quit Explorer using Task Manager and then run Explorer again, all the problems temporarily disappear and things work properly. The other thread said that this was only a temporary solution, so I'm expecting the problems to reappear shortly. But this must provide a pointer to where the root problem is, mustn't it?

Rowan
 

My Computer

OS
Windows 7 Pro
I have this exact same problem and it's causing issues with other programs I have installed. Did you ever find a solution?
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Fujitsu Lifebook
OS
Windows 7 Professional 64 bit
Good find, thanks for sharing.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
Back
Top