XP Pro disregards PATH variable

  • Thread starter Thread starter rox.scott
  • Start date Start date
R

rox.scott

I have seen several similar posts, but none that matches my situation
directly:
Whe I restart Windows, the PATH variable seems to be gone.
i.e. cannot run any typical DOS apps (e.g. ping, runas, etc) without
first CD to system32 dir.
If I follow these steps, it works again, but only until I restart my
system again:
Open System Properties Environment Variable editor and rename PATH to
PATH1, then rename back to PATH again and close dialog.
Open a new cmd window and note that Path var works now.

Why is this? I thought there is no longer an autoexec that messes
with the PATH var at system start!?!?!
 
Control Panel|System|Advanced|Environment Variables|System Variables and
make sure that "Path" has
%SystemRoot%\system32;%SystemRoot%
at least somewhere in the string.

Also check that "Path" found at
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
is a type Reg_Expand_Sz string and not type Reg_Sz

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
|I have seen several similar posts, but none that matches my situation
| directly:
| Whe I restart Windows, the PATH variable seems to be gone.
| i.e. cannot run any typical DOS apps (e.g. ping, runas, etc) without
| first CD to system32 dir.
| If I follow these steps, it works again, but only until I restart my
| system again:
| Open System Properties Environment Variable editor and rename PATH to
| PATH1, then rename back to PATH again and close dialog.
| Open a new cmd window and note that Path var works now.
|
| Why is this? I thought there is no longer an autoexec that messes
| with the PATH var at system start!?!?!
 
Thanks for the quick reply Dave.
Answers to both of the above are TRUE.
The PATH var is correct.
XP seems to disregard its contents altogether.

However, I cannot reproduce the problem since closing my Registry...
There is a svchost.exe Application Error that appears on OS shutdown
and startup.
Seems like something is writing to the Registry after Windows is
finished, and this is what is messing up my PATH var.
Since opening the Registry and closing it again (implicit save?) my
PATH var seems to stay intact, even though I made no changes to it.

--scott
 
I'm wondering how you could know this?

"Seems like something is writing to the Registry after Windows is
| finished, and this is what is messing up my PATH var."

When it happens again, before closing the session type;
echo %path%
to see what it returns.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

| Thanks for the quick reply Dave.
| Answers to both of the above are TRUE.
| The PATH var is correct.
| XP seems to disregard its contents altogether.
|
| However, I cannot reproduce the problem since closing my Registry...
| There is a svchost.exe Application Error that appears on OS shutdown
| and startup.
| Seems like something is writing to the Registry after Windows is
| finished, and this is what is messing up my PATH var.
| Since opening the Registry and closing it again (implicit save?) my
| PATH var seems to stay intact, even though I made no changes to it.
|
| --scott
 
As you suggest, my theory is full of conjecture, so here is the
sequence of events:
1. I request Windows shut-down
2. ECHO %PATH% at the last possible moment shows PATH var is correct
3. As Windows is shutting down, I get Windows Event ID 1000: Faulting
application is svchost.exe
4. Event Log also shows Event ID 1517: "Windows saved user registry
while an application or service was still using the registry during log
off...this is often caused by services running as a user account" (FYI,
all services on my machine are as LS or NS, none as user)
5. As windows comes back up, svchost.exe faults again
6. (At my first post, PATH var is also empty at this point, but this
part of the problem seems to be resolved now)

I took this sequence of events to mean that CurrentControlSet is
failing to save at shutdown and hence PATH var is blank when Windows
comes back up.
 
There's really nothing to save as far as %path% is concerned and registry
wise at shutdown or logoff. This tool might help.

http://www.microsoft.com/downloads/...6d-8912-4e18-b570-42470e2f3582&displaylang=en

Svchost.exe is a generic host process name for services that are run from
dynamic-link libraries (DLLs). The Svchost.exe file is located in the
%SystemRoot%\System32 folder. At startup, Svchost.exe checks the services
portion of the registry to construct a list of services that it needs to
load. There can be multiple instances of Svchost.exe running at the same
time. Each Svchost.exe session can contain a grouping of services, so that
separate services can be run depending on how and where Svchost.exe is
started.

To have the service host controller faulting at startup and or shutdown is
definitely not a good thing. Maybe you remember what was last installed or
changed to cause this to start happening.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| As you suggest, my theory is full of conjecture, so here is the
| sequence of events:
| 1. I request Windows shut-down
| 2. ECHO %PATH% at the last possible moment shows PATH var is correct
| 3. As Windows is shutting down, I get Windows Event ID 1000: Faulting
| application is svchost.exe
| 4. Event Log also shows Event ID 1517: "Windows saved user registry
| while an application or service was still using the registry during log
| off...this is often caused by services running as a user account" (FYI,
| all services on my machine are as LS or NS, none as user)
| 5. As windows comes back up, svchost.exe faults again
| 6. (At my first post, PATH var is also empty at this point, but this
| part of the problem seems to be resolved now)
|
| I took this sequence of events to mean that CurrentControlSet is
| failing to save at shutdown and hence PATH var is blank when Windows
| comes back up.
 
As you suggest, my theory is full of conjecture, so here is the
sequence of events:
1. I request Windows shut-down
2. ECHO %PATH% at the last possible moment shows PATH var is correct
3. As Windows is shutting down, I get Windows Event ID 1000: Faulting
application is svchost.exe
4. Event Log also shows Event ID 1517: "Windows saved user registry
while an application or service was still using the registry during log
off...this is often caused by services running as a user account" (FYI,
all services on my machine are as LS or NS, none as user)
5. As windows comes back up, svchost.exe faults again
6. (At my first post, PATH var is also empty at this point, but this
part of the problem seems to be resolved now)
I took this sequence of events to mean that CurrentControlSet is
failing to save at shutdown and hence PATH var is blank when Windows
comes back up.

I might draw different conclusions from this, e.g. that perhaps XP is
smart enough to apply the Path only after it has started up (or at
least started up internal core services etc. and perhaps av and
firewall) so as to reduce spoofing risks.


---------- ----- ---- --- -- - - - -
Gone to bloggery: http://cquirke.blogspot.com
 
so then it should just be a matter of waiting after startup?

BTW, an update: I can now reproduce this issue from a vrigin XPSP2
install with only a single program installation ... so I know the
culprit. However, it always seems to follow the Event ID 1517 noted
above.
 
so then it should just be a matter of waiting after startup?

BTW, an update: I can now reproduce this issue from a vrigin XPSP2
install with only a single program installation ... so I know the
culprit. However, it always seems to follow the Event ID 1517 noted
above.
 
Back
Top