command prompt commands do not work

P

Paul Dailey

When I try to use any of the commands ex. ipconfig,
nslookup, ping and so on I get and error message is not
recognized as an internal or external command, operable
program or batch file. Not sure why can see the commands
in the system32 folder. Any help would be great thanks
 
H

Herb Martin

Follow Torgeir's link but usually this problem is a missing or corrupt
environment path variable....

Open a command Prompt (not by running a program directly but by clicking
on or running CMD.exe the command processor) -- it is a good practice for
an Admin to keep one (or more) of these open continuously.

Type: set path

Inspect the result and determine if you System32 and other command locations
are listed.
 
M

Matthias Tacke

Herb Martin said:
Follow Torgeir's link but usually this problem is a missing or corrupt
environment path variable....

Open a command Prompt (not by running a program directly but by clicking
on or running CMD.exe the command processor) -- it is a good practice for
an Admin to keep one (or more) of these open continuously.

Type: set path

Inspect the result and determine if you System32 and other command locations
are listed.

Your tip with the command window open is good, Herb Martin
but it doesn't help in case an app in the background garbled the path.
Since the running command inherits the path when invoked it shows an
old path.
Clicking START/Execute.../CMD.EXE gets actual settings.
Btw. I always have an icon on the desktop and in the quick start bar.

If in the cmd window %systemroot%\system32\ipconfig works and ipconfig
not, its assumable the path is garbled.
One some computers with more then one bootable os using %systemroot%
helps also with batches to work in all instances without change.
 
H

Herb Martin

Your tip with the command window open is good, Herb Martin
but it doesn't help in case an app in the background garbled the path.
Since the running command inherits the path when invoked it shows an
old path.

Actually I didn't intent the "open command prompt" to FIX this problem,
just as a best practice and a way to check.

Presumably anyone who cannot figure out why the command prompt
doesn't work is likely starting the commands from Explorer (and closing
it each time).

IF the prompt is corrupt from Explorer, then it is likely corrupt in the
Registry BUT...

One command windows cannot garble the path for other command prompts
(they are in separate memory spaces and already spawned with environments
as child processes.)
If in the cmd window %systemroot%\system32\ipconfig works and ipconfig
not, its assumable the path is garbled.

That's a good way to tell. Unless the whole environment is trash and
%systemroot%
is also missing.
One some computers with more then one bootable os using %systemroot%
helps also with batches to work in all instances without change.

I agree -- it is not a good idea to ALWAYS depend on C:\WinNT or whatever.

Typing "Set <enter>" lets one see the current environment and maybe see any
obvious problems.
 
M

Matthias Tacke

Herb Martin said:
Actually I didn't intent the "open command prompt" to FIX this problem,
just as a best practice and a way to check.
I didn't intend to lower you tip - just enhance. But as you pointed out
it wasn't well thought by me. If a cmd is open you would use it instead
of opening a new one.
Presumably anyone who cannot figure out why the command prompt
doesn't work is likely starting the commands from Explorer (and closing
it each time).

IF the prompt is corrupt from Explorer, then it is likely corrupt in
the Registry BUT...

One command windows cannot garble the path for other command prompts
(they are in separate memory spaces and already spawned with
environments as child processes.)


That's a good way to tell. Unless the whole environment is trash and
%systemroot%
is also missing.


I agree -- it is not a good idea to ALWAYS depend on C:\WinNT or
whatever.
Typing "Set <enter>" lets one see the current environment and maybe
see any obvious problems.
But newbies have problems identifying problems with the path. And when
%systemroot% is garbled problems would arise in starting the os itself.
Problems wouldn't then be associated with cmdprompt I assume.
 
H

Herb Martin

But newbies have problems identifying problems with the path. And when
%systemroot% is garbled problems would arise in starting the os itself.
Problems wouldn't then be associated with cmdprompt I assume.

Not necessarily. SystemRoot is not set until after the Kernel starts (that
is the OS) and the enviroment can be trashed by a subsequently running
program.
 
T

Torgeir Bakken (MVP)

Herb said:
Follow Torgeir's link but usually this problem is a missing or corrupt
environment path variable....

Open a command Prompt (not by running a program directly but by clicking
on or running CMD.exe the command processor) -- it is a good practice for
an Admin to keep one (or more) of these open continuously.

Type: set path

Inspect the result and determine if you System32 and other command locations
are listed.

The OP should note that if he sees environment variables in the output of the
command "set path" (variables surrounded with %), that part of the path
containing those will not work, and the cause of the problem is that a rough
install have changed the Path entry in registry from REG_EXPAND_SZ to REG_SZ.
http://home.comcast.net/~stewartb/cmdprompt.html#6 explains how to fix this.
 
M

Matthias Tacke

Herb Martin said:
Not necessarily. SystemRoot is not set until after the Kernel starts (that
is the OS) and the enviroment can be trashed by a subsequently running
program.
I don't want to get over-subtle in what the os is. When the user logs in
he will shurely discover anomalies if %systemroot% isn't set properly.
He won't then ask here for help.
 
P

Paul Dailey

Thanks to everyone for your help the reg hack fixed the
problem.

Thanks again
Paul
 

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

Similar Threads


Top