Solved: Command Prompt Error - 'command' is not recognized...

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Nostzz

Thread Starter
Joined
Sep 3, 2007
Messages
111
Hello everyone :)

Recently a problem has arisen with my system.

Previously I have been doing work that requires me to unplug my network connection and I need to check my IP address each time I plug it in again. I guess it's not set for static IP.
Anyways to do this I usually go into Command Prompt and type 'ipconfig'

Now however I just get "'ipconfig' is not recognized as an internal or external command, operable program or batch file".

The directory is the same as its always been, I can change it but it doesn't seem to matter what it is.

I've checked many other posts and is there something possibly wrong with my PATH variable? I used the command 'echo %PATH%' and it works, the list it gives is very garbled however.

I'm not sure what might have made this problem arise, but I would greatly appreciate any help.

Thanks! :eek:
 
Joined
Dec 9, 2000
Messages
45,855
To open a command prompt -- type cmd not "command".

If you are getting errors even from a proper "command" window, then the path environment is likely a cause.

Run sysdm.cpl and select Advanced > Environment.

Under "System Variables", select the "Path" field from the scroll window.

The leading path should be what you see in bold here:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem; C:\PROGRA~1\COMMON~1\MGISHA~1\Video;C:\Program Files\Common Files\Adaptec Shared\System;C:\Program Files\Support Tools\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Universal Extractor\bin

the rest, in my case, has been installed by software and is not default.
 

WhitPhil

Gone but never forgotten
Trusted Advisor
Joined
Oct 4, 2000
Messages
8,684
Ipconfig.exe lives in \Windows\System32
From Explorer, confirm the file is still there.

And, at the command prompt, enter set and post back the contents of PATH.

Or confirm that it contains a reference to C:\windows\system32. If it doesn't the command will not run.

You could enter \windows\system32\ipconfig if the path is incorrect.
 

Nostzz

Thread Starter
Joined
Sep 3, 2007
Messages
111
Here's the PATH from system variables:

%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\PROGRA~1\DISKEE~1\DISKEE~1\

Ipconfig.exe still exists in \Windows\System32 also and doing 'cd C:\' in command prompt and then putting in \windows\system32\ipconfig will run the .exe

So I guess the PATH is just messed up somewhere. The immediate problem is solved sense I can get my IP address but can anyone see the problem with my PATH file?

Thanks Rollin' Log and WhitPhil for your fast replies. :)
 
Joined
Dec 9, 2000
Messages
45,855
Is "c" your boot drive now and has it always been? Has Windows always been installed on it?

I don't know why %systemroot% is evidently not pointing to c:\windows in that Path information -- but you could try subsitituting it and see what happens.
 

WhitPhil

Gone but never forgotten
Trusted Advisor
Joined
Oct 4, 2000
Messages
8,684
Open Control Panel > System > Advanced Tab > Environment Variables Button
In the bottom window, select PATH

If it still reads Systemroot(as I expect it will), select Edit Button, and replace it by c:\windows

You can also check the setting of Systemroot by doing Echo %Systemroot% at the command prompt.
 

Nostzz

Thread Starter
Joined
Sep 3, 2007
Messages
111
In the environment variables under Path it does say

C:\WINDOWS\system32;C;\WINDOWS;...

but I get

%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\PROGRA~1\DISKEE~1\DISKEE~1\

As the Variable value when I click Edit.

In Command Prompt doing 'Echo %Systemroot%' yields C:\WINDOWS

How could I change the Path to just say C:\WINDOWS\system32?

Or do I not want to do that? :confused:
 
Joined
Dec 9, 2000
Messages
45,855
Doesn't make any sense.

But let's clarify something -- if you do NOT "CD" to to "c" first, the command does not find a valid copy of ipconfig?

Is there by any chance something named "ipconfig" on the root directory? Perhaps something which could be corrupt or have a different extension?

You are actually bypassing "c:" in the path execution by running the command from there. It then goes directly to "windows" and what follows.

And for what it's worth, you could probably copy the ipconfig.exe to the c: directory and get it to execute directly.

Do other commands find their way to their executable, for example: tracert ? or ping ?

Indeed to run cmd.exe itself from Start > run, requires correct path information I believe -- since it too resides in the system32 directory.
 

Nostzz

Thread Starter
Joined
Sep 3, 2007
Messages
111
But let's clarify something -- if you do NOT "CD" to to "c" first, the command does not find a valid copy of ipconfig?
Right when I open a Command Prompt this is what I see...

Microsoft Windows XP [Version 5.1.2600]
<C> Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\MonkeyBoy.MONKEYBO-BD1C8C>

I used to be able to just type 'ipconfig' to get the info. Now I have to "CD" to C:\ and then type out 'WINDOWS\System32\ipconfig' to get anything. Even if I do 'WINDOWS\System32\ipconfig' before changing to C:\ I get "The system cannot find the path specified.

Is there by any chance something named "ipconfig" on the root directory? Perhaps something which could be corrupt or have a different extension?

You are actually bypassing "c:" in the path execution by running the command from there. It then goes directly to "windows" and what follows.

And for what it's worth, you could probably copy the ipconfig.exe to the c: directory and get it to execute directly.
You kinda lost me there.

Do other commands find their way to their executable, for example: tracert ? or ping ?
Neither work even when I "CD" to C:\

Sorry if I'm dragging this out. System files arn't one of my strong points :(
 
Joined
Dec 9, 2000
Messages
45,855
Let's look at the commands "tracert" and "ping" to see if we can get some clues here.

Does tracert.exe and ping.exe exist in the system32 directory -- (and nowhere else in the path C:\windows\system32 or in your User Profile?

If you open them directly from there, do they open?

Do all commands that exist in the system32 directory open directly from there or if you send them to the desktop as a shortcut?

By the way, if you send the file cmd.exe to the desktop as a shortcut -- it will open in the system32 directory -- not your user profile. This may be a convenient workaround if we can't fully sort this out. Alternately you can right click on the Start Menu Shortcut for it and select properties and alter the path set in the "start in" field.
 

Nostzz

Thread Starter
Joined
Sep 3, 2007
Messages
111
Yes ping.exe and tracert.exe exist in C:\WINDOWS\system32

They also do open from there. Double clicking on 'ping' opens a Command Prompt window for less than a second displays the ping options then closes but I think it's doing what it's supposed to.

Using a search through the entire contents of C:\ there was no other ping.exe or tracert.exe.

When I open the properties of cmd.exe this is what comes up.

Target: %SystemRoot%\system32\cmd.exe

Start in: %HOMEDRIVE%%HOMEPATH%

Should these be changed and to what...C:\WINDOWS\system32\cmd.exe?
 
Joined
Dec 9, 2000
Messages
45,855
Change the "start in" path to c:\windows\system32

That will get you a prompt in the system32 directory and while we haven't solved the source of the problem -- it still should work the way it is supposed to.
 

WhitPhil

Gone but never forgotten
Trusted Advisor
Joined
Oct 4, 2000
Messages
8,684
If you open a command prompt (CMD), does PING or TRACERT run from there, or do you get the same "error" message.
My guess is that you will get the same message, but have no idea why the path is not being followed?
 

Nostzz

Thread Starter
Joined
Sep 3, 2007
Messages
111
Alright I changed the "start in" path to c:\windows\system32 and everything seems to work now. 'ipconfig' 'tracert' 'ping' they all work. :)

Should I be worried about the "source of the problem" whatever it is?

Thanks so much for your guys help. :)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top