"Open With" window appears when attempting to open a Command Prompt window?
- By Ramesh Srinivasan
- Published November 15, 2007
A question which I came across recently...
I go to Start, Run and type in "cmd", I get an Open With prompt window that asks me to
Choose the program you want to use to open this file: File: cmd

I've used the "Browse" button to locate the Windows Command Processor, but I have to select it from the list of "Program." The "Always use the selected program to open this kind of file" check box is grayed out. I don't even know why Windows has decided cmd is a file to be opened by an external application.
This problem happens if there is a file named CMD in your profile folder, and Windows tries to execute it when you type CMD (without the .exe suffix, the file extension) in Start, Run dialog.
Click Start, Run and type:
%comspec% /k dir "%userprofile%\cmd*" /s
Press {ENTER}
This lists files within your profile directory which contain cmd in the file name . Spot the files which contain the names (CMD, CMD.EXE, CMD.COM, CMD.BAT) located within your user profile path and rename them or move them somewhere else.
If those files appeared in your user profile folder without you doing anything, then it's a good idea to run a thorough scan for Viruses and other Malware.
When you type CMD in Start-Run dialog, Windows searches for the file in the following locations in the same order given, and executes the first one found:
- Your user profile folder
- Checks the App Paths registry key
- Searches all the folders included in the PATH variable
The search order may vary depending upon the Operating System you use, and the Service Pack level of your system.
Note: The problem was fixed when the user removed a 0-byte file named cmd in his profile folder. If you run across a similar situation at some time, this blog entry should help.
