PDA

View Full Version : command prompt problem



nisarga
06-03-2008, 02:54 PM
Hey friends I am using XP SP2.hey i got a problem in command prompt. The problem is if I go to run and type cmd, it wills gives, open with, and choose the program you want to use to open the file. I want know how to correct it. If any buddy knows plz tell me soon...

lynx
06-03-2008, 05:05 PM
There are a couple of possibilities which could have gone wrong.

You (or an application or virus) may have changed the default execution type for the .exe file extension. The segment of registry contained in the attached file dotexe.zip should set it back to default.

The second possibility is that you (or an application or virus) may have removed the default shell entry for exefiles. The segment of registry contained in the attached file exeshell.zip should set it back to default.

In either case just extract the registry file from the attachment and double click to merge it into your registry. If your settings are already correct it will have no effect.

To fully activate the changes you need to log off and log back on.

mbucari1
06-03-2008, 05:44 PM
Just so I understand...

You start a program from the "run" box. The program will launch then exit.

Is it a command line program that you're running? If so, try typing "cmd /k" before the program path in the run box.

example

cmd /k c:\someProgram.exe

nisarga
06-04-2008, 07:35 AM
Hey what I am trying to say is i am going to
Start-run- type cmd-its going to open with n choose the program u want to use to open this file...
And I tried both the Solutions but still it’s giving the same error :frusty:. r there any another Solutions……..

lynx
06-04-2008, 10:18 AM
Is it just when you type "cmd", or does it do the same if you type the name of other programs (such as regedit). I assumed it was any program.

If it is just cmd then try typing the full name - cmd.exe. If you get the same result then the cmd.exe program may be corrupted.
If it runs correctly then the system may be finding another file called cmd but with a different registered extension before it finds cmd.exe, and does not know what to do with it.

nisarga
06-04-2008, 11:26 AM
Hey that cmd.exe is working...and if i type any other commands it working. But its only cmd command is not working n giving that error’s. Why its giving like that.

Shiranai_Baka
06-04-2008, 03:09 PM
Can you provide a screenshot? It'll be a lot easier to see what the problem is with a screenshot.

lynx
06-04-2008, 06:56 PM
The problem is that there's a file called cmd.xxx (I don't know what the xxx will be) which is being treated as a program, but the system doesn't know what to do with it. This is in addition to the correct cmd.exe program.

First, you need to know the path extensions that your system will treat as executable programs. Right click on "My Computer" and select "Properties".
Choose the "Advanced" tab and press the button marked "Environment Variables".

First of all, look in the top box ("User variables for xxxxx") to see if there is a variable called "PATHEXT" - it should not be there but if it is make a note of it's contents then select and delete it.

Assuming you didn't find it in the top box, find the variable called "PATHEXT" in the bottom box ("System variables") and make a note of it's contents. The default should be ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH", if it is any different from that I'd advise setting it to that, at least for the time being.

Come back and tell us what you found. If you had to delete or change the "PATHEXT" variable in either of the boxes you've probably already cured the problem.

If you didn't have to change anything, then the system has forgotten how to deal with one of the extensions, and I'll check out what you need to do to fix it.

bigboab
06-04-2008, 08:11 PM
This is my second attempt.:( I hope it is of help. You can't have two or more Executable files with the same 'first part' name, for obvious reasons, the computer would not know which one to run. Remembering you only need to enter the first part of an executable file for it to run. So if you have entered CMD.XXX (used to be command.com) which is the DOS shell then it is up and running. If you try to run it again while it is running you will get an error message.

If this does not help please ignore me. Almost everyone else does.:lol:

lynx
06-04-2008, 08:44 PM
This is my second attempt.:( I hope it is of help. You can't have two or more Executable files with the same 'first part' name, for obvious reasons, the computer would not know which one to run. Remembering you only need to enter the first part of an executable file for it to run. So if you have entered CMD.XXX (used to be command.com) which is the DOS shell then it is up and running. If you try to run it again while it is running you will get an error message.

If this does not help please ignore me. Almost everyone else does.:lol:
Sorry Bob, that's simply not true.

If you don't specify where the program is, the "PATH" variable determines which folders the system searches and the order in which they are searched.

If you don't specify the extension the "PATHEXT" variable determines which ones are possible matches, but does not affect the order in which they are checked.

For example, if you create a file called cmd.abc in the C:\Windows\System32 folder, then just type "cmd" the system will find cmd.abc before cmd.exe because it is earlier alphabetically. It will then check "PATHEXT" and will normally reject the file because .abc is not in "PATHEXT", and look for the next file. However, if you add .abc anywhere in "PATHEXT" the system will select that file as a match, because the order in "PATHEXT" is not important.

Once the system has found a matching file, whether by clicking on the file, typing it's full path or by allowing the system to find it for you, it will try to execute the file by comparing the extension with the contents of the registry. If there is no equivalent class in the registry then you get the error message shown in this problem.

bigboab
06-04-2008, 09:06 PM
This is my second attempt.:( I hope it is of help. You can't have two or more Executable files with the same 'first part' name, for obvious reasons, the computer would not know which one to run. Remembering you only need to enter the first part of an executable file for it to run. So if you have entered CMD.XXX (used to be command.com) which is the DOS shell then it is up and running. If you try to run it again while it is running you will get an error message.

If this does not help please ignore me. Almost everyone else does.:lol:
Sorry Bob, that's simply not true.

If you don't specify where the program is, the "PATH" variable determines which folders the system searches and the order in which they are searched.

If you don't specify the extension the "PATHEXT" variable determines which ones are possible matches, but does not affect the order in which they are checked.

For example, if you create a file called cmd.abc in the C:\Windows\System32 folder, then just type "cmd" the system will find cmd.abc before cmd.exe because it is earlier alphabetically. It will then check "PATHEXT" and will normally reject the file because .abc is not in "PATHEXT", and look for the next file. However, if you add .abc anywhere in "PATHEXT" the system will select that file as a match, because the order in "PATHEXT" is not important.

Once the system has found a matching file, whether by clicking on the file, typing it's full path or by allowing the system to find it for you, it will try to execute the file by comparing the extension with the contents of the registry. If there is no equivalent class in the registry then you get the error message shown in this problem.

I was quoting MS-DOS from 1980's 90's. I don't know or have never heard of pathext. I was thinking of the old Command prompt.
Too late to learn now. I was under the wrong impression that the command prompt took you to the old operating system C:\> Prompt.
I was wrong in terms of century.:whistling

nisarga
06-05-2008, 01:41 PM
guys i dint knw wat to do now can u tell me how to slove the problem..plz guys help me..wat to do...

lynx
06-05-2008, 03:44 PM
you need to know the path extensions that your system will treat as executable programs. Right click on "My Computer" and select "Properties".
Choose the "Advanced" tab and press the button marked "Environment Variables".

First of all, look in the top box ("User variables for xxxxx") to see if there is a variable called "PATHEXT" - it should not be there but if it is make a note of it's contents then select and delete it.

Assuming you didn't find it in the top box, find the variable called "PATHEXT" in the bottom box ("System variables") and make a note of it's contents. The default should be ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH", if it is any different from that I'd advise setting it to that, at least for the time being.

Come back and tell us what you found. If you had to delete or change the "PATHEXT" variable in either of the boxes you've probably already cured the problem.

If you didn't have to change anything, then the system has forgotten how to deal with one of the extensions, and I'll check out what you need to do to fix it.It depends on what you find when you've done this.

Also, you could search for files/folders called "cmd.*", one of them will be the offending item.

nisarga
06-10-2008, 10:25 AM
i check the things what u told me to check..but its all correct..than what should i do..still i have same problem..n vry thanks for ur help M.R lynx

lynx
06-10-2008, 06:52 PM
I assume you mean that there was no Environment variable called PATHEXT in the user environment and that the PATHEXT in the system environment was the same as default.

Did you find any other files called cmd.<???>, where .<???> is one of the items in the PATHEXT variable, in other words one of:
cmd.COM
cmd.BAT
cmd.CMD
cmd.VBS
cmd.VBE
cmd.JS
cmd.JSE
cmd.WSF
cmd.WSH

I should probably point out that you need to be able to see file extensions to answer that question, and you also need to be able to see protected operating system files. In case you don't know how to see those, open up "My Computer" and select "Tools/Folder Options". Choose the "View" tab and uncheck the boxes labelled "Hide extensions for known file types" and "Hide protected operating system files". Also select option "Show hidden files and folders" just in case the file causing the problem is hidden. Click OK.

If you had to make any changes in that bit, repeat your search for files called "cmd.*", and let us know what you find. If you only find "cmd.exe" then I don't know what to suggest next.

nisarga
06-18-2008, 11:35 AM
Thanx MR Lynx.... now its working

Chewie
06-20-2008, 10:54 PM
Every time my kids tell me I'm a 'Windows Wizard', all I need do to bring me back to Earth is read one of your posts, Chris. :)