Thursday, July 28, 2011

cmd.exe works but cmd does not work in Start Run in Windows XP?

Once I was working on my office computer trying to experiment something and after sometime I realised that the experiment has led me to a great problem. I was not able to open command prompt from Start -> Run available in Windows. What was the problem, just few minutes back I was very much using the Run Command to open Windows Command Prompt.

When I tried typing cmd in Start -> Run I was greeted by an "Open With" dialog with disabled "Always use the selected program to open this kind of file" option and that too unticked.

Hmmm.. well thats a difficult situation indeed and after hours of surfing the internet I finally reached to nowhere. None of the articles actually pointed me to the right direction and so I thought that if I get a solution to bringing my cmd back on track I will try to post the same so that others could be benefitted.

One more crazy thing I found during all this hunting for the correct solution was that when I type cmd.exe in the Start -> Run then my command prompt opens correctly. So what is the problem with cmd.

Well now as the answer is with me I would share the same here. The answer to this big question rests in the way Run command recongnises an Microsoft Excel program by simply typing excel in Start -> Run and similarly Microsoft Word through winword.

Coming straight to the answer without waisting any more time here is the solution -


But first just an advice so that you dont end up corrupting your Windows - As this is a registry hack so would request you to take a backup of the registry entries you are trying to make changes to and be very careful while you update the registry. Registry is not a place to play around as it is a sort of Windows database for finding relevant entries. Now with the advice given the solution is listed below -

1. Go to Start -> Run and type regedit and Ok button.
2. The above step will open registry editor for you. Now go to the following entry -
     HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppPaths\
3. Create a new Subkey under AppPaths with the following name - cmd.exe. Please do mind the name here as if you will create this Subkey with the name cmd1.exe then the command prompt will open by entrying cmd1 in Start -> Run instead of cmd.
4. Now click on the new Subkey and in Default enter the full path for the cmd.exe which will be -
    C:\WINDOWS\system32\cmd.exe
5. Make a new string entry called PATH and enter the following path for the command -
    C:\WINDOWS\system32\

and with this all is done and we are ready to start using our very own cmd once again through Start -> Run in Windows.

No comments: