Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

an hour ago, after a normal restart, my PATH environment variable just disappeared.

It does not appear in the:

  • not in System Properties/advanced/environment variables.
  • nor under "User" and not under "System" variables
  • not in the registry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

Fortunately, I have backup of my env vars, so the only question is

WHY did it happen? (and not "how to repair it")


  • I'm on Windows XP, sp3.
  • before the incident I tried to install a new monitor, which didn't work
  • I had other custom variables that I created manually for my own needs, and all these variables remained intact. Only the PATH variable vanished!
  • all these variables (both PATH and my manually defined vars, where defined as System vars, not User vars
  • since there was no PATH var, the default PATH pointed to C:\Windows\system32. this rules out security attack of that sort, I guess. (or just proves the opposite?!)

edit : I ruled out gremlins, because it had happened before midnight && after 9PM

edit2: I ran 2 registry cleaners just 3 days ago (reg-mechanic and regSeeker). the first took tons of time to run. It's not magic fairies but it's pretty close ;)

edit3 - I did not touch or change my env variables lately, so it wasn't "by accident". besides, it happened twice already.

share|improve this question
I would suspect a boot sector virus of some sort. – Moab Sep 13 '11 at 23:34
Magical fairies? Act of god? Gremlins? Failed monitor install? What have you already done to try and determine 'why'? – Ƭᴇcʜιᴇ007 Sep 13 '11 at 23:38
had i known what to rule out, i would've done and write about it. suggestions (based on your advice i ruled out gremlins.) – Berry Tsakala Sep 14 '11 at 0:19
maybe you went to edit the path, highligted it, and accidentally clicked delete.. or you went to delete a variable near it, accidentally deleted path.. i've used xp for almost 10 years and not seen that. you could get a program to monitor the registry key there. – barlop Sep 15 '11 at 1:22
Did you install anything recently? Ive seen some program installers wipe out the path variable before. – Keltari Sep 17 '11 at 17:35
up vote 0 down vote accepted

it was probably due to misuse of setx.exe inside a vbs script.

when using setx.exe, always surround variable contents with double-quotes, e.g.

setx.exe varname "value of that var" -m

from vb variants:

cmd = "setx " + varName + " """ + Value + """ -m"
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .