Need help with command prompt path

G

Guest

Whenever I use the command prompt on my XP PC, the default path is my mapped
network drive.
I then change to C:\ to use commands such as PING etc. but I always get the
message that 'ping' is not recognized as an internal or external command,
operable program or batch file.

I then have to change to the c:\windows\system32 folder before it works.

I checked my 'System Variables' under 'System Properties, Advanced,
Environment Variables', and have the following under PATH:
%SystemRoot%\system32;%SystemRoot%.

How do I correct my WinXP so that I can use command lines without having to
change the path manually everytime?

Please advise.
 
P

Pegasus \(MVP\)

TonyV said:
Whenever I use the command prompt on my XP PC, the default path is my mapped
network drive.
I then change to C:\ to use commands such as PING etc. but I always get the
message that 'ping' is not recognized as an internal or external command,
operable program or batch file.

I then have to change to the c:\windows\system32 folder before it works.

I checked my 'System Variables' under 'System Properties, Advanced,
Environment Variables', and have the following under PATH:
%SystemRoot%\system32;%SystemRoot%.

How do I correct my WinXP so that I can use command lines without having to
change the path manually everytime?

Please advise.

- How exactly do you start a Command Prompt?
- What does your path in the Command Prompt look like?
Type path {Enter} to find out.
 
A

alanglloyd

Check your %SystemRoot% and %System% settings by opening a command
window and entering the command ...

SET

... or ...

SET | MORE

.... to see the list of environment variables. If you have a lot of
environment variables press Return to get next line, Space to get next
pageful.

Also right-click and select properties on the Programs | Accessories |
Command Prompt menu item. I have ...

Target : %SystemRoot%\system32\cmd.exe

Start In : %HOMEDRIVE%%HOMEPATH%

My PATH environment variable (enter PATH command) includes C:\WINDOWS
and C:\WINDOWS\SYSTEM32 as a string, not the %SystemRoot% variable.

Alan Lloyd
 
G

Guest

i changed my path enviroment to C:\WINDOWS
and C:\WINDOWS\SYSTEM32 and removed the %systemroot% entries.
Now it's working fine.

Thankyou.
 
P

Pegasus \(MVP\)

You actually cured the symptoms, not the cause. The registry
entry that defines your path is of the wrong type. That's why
I asked my question (which you did not answer).
 
G

Guest

I access command prompt by clicking 'Start, Run' and entering CMD.
Then I get this prompt: P:\>. This is one of my network drives.
When I then change to C: Drive, the prompt is C:\.

The path look as follows:
PATH=C:\PROGRA~1\Borland\Delphi5Bin;C:\PVSW\BIN;%systemroot%;%systemroot%\system32;%systemroot%\system32\wbem;C:\PROGRA~1\Symantec\PC
 
P

Pegasus \(MVP\)

You confirm my suspicion. When you type "path" at the
Command Prompt then you're supposed to get a fully
resolved path without any variables. Your path shows
unresolved variables and this is why your commands failed.

The root cause is an incorrect value type in the registry
for "path". The 'Path', 'Windir', 'Os2LibPath' and 'ComSpec'
must be of type REG_EXPAND_SZ, not REG_SZ.
I recommend that you change it back to what it should be.
You can see it here:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
 
G

Guest

Thanks.
Now the problem is sorted out by the root cause (like it should be).

Much appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top