There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Windows XP
Tag Cloud
access acer asus bios bsod computer crash drive driver drivers error ethernet excel freeze games gaming hard drive hardware hdmi internet java laptop malware memory monitor motherboard music network obp printer problem ram random registry router slow software sound trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Windows XP >
Solved: CMD problems with Command.

Reply  
Thread Tools
johnpepper's Avatar
Member with 38 posts.
 
Join Date: Aug 2009
22-Aug-2009, 06:10 PM #1
Solved: CMD problems with Command.
Ok well I need your help. You see my cmd is working fine. Then one day I open run and type in cmd and then enter. I type in ipconfig and it says ipconfig isn't an external command or something like that. Anyways I fixed the problem by typing in run C:\WINDOWS\system32\cmd.exe and enter. Weird enough it worked when i typed in ipconfig, and other commands. If I typed in cmd that was open from the run any commands wouldn't work. I tried creating an shortcut from the actual cmd file and trying commands but it still doesn't work. Well sometimes I code stuff or download .bat files because I need of em. And I try to open the file but it always usually runs fine but after that incident I try to open any .bat file and it just opens it and the window closes so fast. I don't know how to fix this problem uahghhh it's a pain in the butt lol. It's getting me so mad! I just want to use my normal cmd .

I have windows xp by the way.

I'd be happy if you guys help me out .
TerryNet's Avatar
Computer Specs
Moderator with 48,385 posts.
 
Join Date: Mar 2005
Location: Ottawa, IL
Experience: Intermediate to Advanced
22-Aug-2009, 06:52 PM #2
Search for cmd (all files and folders) on your C drive to see the different places from which a cmd may be coming. Don't search for cmd.exe, because you want to also find any cmd.bat, for example.

In a Command Prompt window, whatever you have to do to get there, type the single word PATH.

That will give you a list of the folders that are searched, in order, to find a command when you just type "cmd." Between that list and your search list you can tell what cmd is running, and maybe determine why and what's wrong.

FWIW my PATH is

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System

and the first part of it should be pretty standard. Note that for my PATH the cmd in C:\WINDOWS\system32 would be the default one.
johnpepper's Avatar
Member with 38 posts.
 
Join Date: Aug 2009
23-Aug-2009, 12:28 PM #3
Thank you for your suggestion. When I searched for cmd in the search box i found 4 cmd(s). 2 of them were shortcuts from the default cmd which was from C:\WINDOWS\system32\cmd.exe. The other one was the actual cmd from C:\WINDOWS\system32\cmd.exe. And the last one was from C:\WINDOWS\system32\cmd.exe. I tried serveral commands in the shortcut cmd and it didn't work. I tried some commands on the two other cmd's and it worked. So what do you think I should do?
TerryNet's Avatar
Computer Specs
Moderator with 48,385 posts.
 
Join Date: Mar 2005
Location: Ottawa, IL
Experience: Intermediate to Advanced
23-Aug-2009, 03:37 PM #4
I just did a search for cmd on my (XP) machine. Geez, didn't realize there were so many files with those 3 characters in the name. Anyhow, as I assumed, there are no cmd shortcuts. You probably want to get rid of the shortcuts, but first I think you should right click on each shortcut and see what the Target is. The Target is the actual file that would be run, and it may be some kind of malware. I don't know of any legitimate reason why there would be cmd shortcuts unless you created them yourself.
johnpepper's Avatar
Member with 38 posts.
 
Join Date: Aug 2009
23-Aug-2009, 04:40 PM #5
one of the shorcuts are in my documents and one of them are from my administrator folder. Lol. Anyways I deleted both the shortcuts and tried remaking a shortcut from the actual cmd file and weird enough I tried some commands and it worked! Thanks but when I type in the run box cmd or CMD commands still don't work. .
TerryNet's Avatar
Computer Specs
Moderator with 48,385 posts.
 
Join Date: Mar 2005
Location: Ottawa, IL
Experience: Intermediate to Advanced
23-Aug-2009, 04:45 PM #6
What is your PATH?
johnpepper's Avatar
Member with 38 posts.
 
Join Date: Aug 2009
23-Aug-2009, 09:50 PM #7
Is the path the shorcut opening from? If it is the path for my cmd shortcut is C:\WINDOWS\system32\cmd.exe. That is my actual cmd by default which is in the folder.
TerryNet's Avatar
Computer Specs
Moderator with 48,385 posts.
 
Join Date: Mar 2005
Location: Ottawa, IL
Experience: Intermediate to Advanced
23-Aug-2009, 10:19 PM #8
See post # 2 beginning with the 2nd paragraph.
TheOutcaste's Avatar
Computer Specs
Distinguished Member with 9,048 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
23-Aug-2009, 10:23 PM #9
Might help to get the Comspec value, and the pathext value as well.

Open a working Command Prompt and type the following two lines, pressing enter after each.
This will create a file on your desktop named Variables.txt that will contain the values for ComSpec, Path, and PathExt.
Double click the file to open it in Notepad, then copy and paste the contents into your next reply (When Notepad opens, press CTRL+A, then CTRL+C, click in the Reply windows, press CTRL+V)
Code:
set coms >"%userprofile%\Desktop\Variables.txt"
set path >>"%userprofile%\Desktop\Variables.txt"
There is a space before > in both lines, and the 2nd line does have two (>>)
__________________
Microsoft MVP - Windows Expert - Consumer
Of course I know all the answers ; I just don't always match the answers to the right questions

johnpepper's Avatar
Member with 38 posts.
 
Join Date: Aug 2009
24-Aug-2009, 10:09 AM #10
Thanks for your help The Outcaste but I typed in the code correctly for the first line and pressed enter and then the second line and did what you told me but I didn't get a notepad file in my desktop. I don't know why .
johnpepper's Avatar
Member with 38 posts.
 
Join Date: Aug 2009
24-Aug-2009, 10:10 AM #11
http://i32.tinypic.com/30a5o5h.jpg

I typed in path in my cmd and I took a screenshot of what my cmd said. Take a look at the picture from the link. Thanks for your help.
TerryNet's Avatar
Computer Specs
Moderator with 48,385 posts.
 
Join Date: Mar 2005
Location: Ottawa, IL
Experience: Intermediate to Advanced
24-Aug-2009, 01:19 PM #12
That PATH certainly explains why you are not getting the correct "cmd".

Maybe your %userprofile% variable is messed up also. You could try those two set commands again using just C: in place of %userprofile%\Desktop. Then look for the Notepad file directly on the C: drive.

Otherwise, I'm going to take a back seat and let TheOutcaste respond w/o my hindrance. I don't know if that PATH is just the result of something screwing up or has worse (malware) connotations.
johnpepper's Avatar
Member with 38 posts.
 
Join Date: Aug 2009
24-Aug-2009, 01:56 PM #13
Thanks for your help I typed in C: replacing the %userprofile%\Desktop and I got the notepad text in my c drive anyways, I opened up the notepad and this is what I got. COMSPEC=C:\WINDOWS\system32\cmd.exe
johnpepper's Avatar
Member with 38 posts.
 
Join Date: Aug 2009
24-Aug-2009, 02:00 PM #14
TerryNet suggest me to replace the %userprofile%\Desktop with C: for the code because the notepad didn't appear on my desktop and I opened the notepad file and it anyways it said

COMSPEC=C:\WINDOWS\system32\cmd.exe.

So what should I do next?
TheOutcaste's Avatar
Computer Specs
Distinguished Member with 9,048 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
24-Aug-2009, 08:26 PM #15
Quote:
Originally Posted by TerryNet View Post
Otherwise, I'm going to take a back seat and let TheOutcaste respond w/o my hindrance.
Never a hindrance!

Barring a typo, I don't know why it wouldn't appear on the desktop, though from the screenshot this appears to be a non-english version of Windows.
If your username contains characters other than the standard ASCII characters that might be a factor.

If %userprofile%\Desktop gets expanded to a folder that doesn't exist, it should give this error:
The system cannot find the path specified.
If you didn't get an error, the file was put someplace.

You can always use search and search for variables.txt to see where it ended up.
On rare occasions I've seen files get created off of the visible desktop, so it may just be off screen.

The first COMSPEC value is the correct one:
C:\WINDOWS\system32\cmd.exe
so that part is OK. (I'm guessing the period at the end in the 2nd post was added when you typed the reply).

I'm not sure how the path ended up this way. Haven't heard of malware doing this but I'm no malware expert.
I have seen glitches where a program doesn't add itself to the path correctly and ends up deleting the current value.
You end up with just the new program in the path, plus anything added after that point.
It is definitely missing the Windows folders which is the reason cmd doesn't work from the run box.
Two other oddities: 1 item without a drive letter, and it and another item are duplicated.
I've broken it down to the separate folders so it's easier to see:
GL
C:\Program Files\Java\jdk1.6.0_14\bin
C:\Program Files\TortoiseSVN\bin
c:\Program Files\Microsoft SQL Server\100\Tools\Binn
c:\Program Files\Microsoft SQL Server\100\DTS\Binn
GL
C:\Program Files\Java\jdk1.6.0_14\bin

The GL doesn't have a drive letter, meaning it will be seen as a relative path, which can cause odd behavior, especially in a Command Prompt.
The items in blue are duplicates.

I'd check and see if you have a C:\GL folder, and if so, make sure you know what it is.

Next we can fix the path variable and see if it resolves the issue. If it gets changed after we fix it and reboot, then it's likely malware at work.

Right click My Computer, click Properties
Click the Advanced tab
Click the Environment Variables button at the bottom
Check under the User variables for username section. There should not be a PATH entry. If there is, copy the value and post back
(Double click on path, press CTRL+C to copy the contents. Then press CTRL+V in the reply window (or notepad))
Under System variables, find the PATH entry and double click it.
The Variable value: box should be selected with it's contents highlighted; Press Delete
Copy and paste the following into the box:
Code:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Java\jdk1.6.0_14\bin;C:\Program Files\TortoiseSVN\bin;c:\Program Files\Microsoft SQL Server\100\Tools\Binn;c:\Program Files\Microsoft SQL Server\100\DTS\Binn;GL
OK your way back to the Desktop, and try Start | Run | CMD and see if it now works.
Now, reboot and see if it still works.
If not, then something is changing that path value; it should only be changed when a program is installed that needs to use the path variable, not that many do.
In that case, time to let the malware experts take over.

Note: %Systemroot% will be expanded to the correct value, usually C:\Windows, and will display that way in the System variables window and the Command Prompt, but will appear as %Systemroot% in the Edit box.
I've left the GL as the last item just in case a program needs it for some odd reason.
You can search your hard drive for a folder named exactly GL, and if none exist, just remove ;GL from the end of the line.
Only other thing that comes to mind is it's the tail end of something that got deleted when the glitch happened,
say something ending with OpenGL, perhaps part of a Video Driver.
I don't have that in the path on any of my systems, but I only have Built in or ATI cards.
__________________
Microsoft MVP - Windows Expert - Consumer
Of course I know all the answers ; I just don't always match the answers to the right questions

Reply

Tags
commands, problems, run, scripts, windowsxp

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:55 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.