0

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.

5
  • I would suspect a boot sector virus of some sort.
    – Moab
    Sep 13, 2011 at 23:34
  • 1
    Magical fairies? Act of god? Gremlins? Failed monitor install? What have you already done to try and determine 'why'? Sep 13, 2011 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.) Sep 14, 2011 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, 2011 at 1:22
  • Did you install anything recently? Ive seen some program installers wipe out the path variable before.
    – Keltari
    Sep 17, 2011 at 17:35

2 Answers 2

0

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"
-1

I have no idea what caused it but I had the same problem so what I did was open cmd and type PATH then I copied what poped out on the screen and open system environment variables clicked new and created a variable named PATH and in value I pasted what I copied from cmd. Hope thid solves your problem

You must log in to answer this question.

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