Tech Support banner

Status
Not open for further replies.
1 - 12 of 12 Posts

·
Registered
Joined
·
272 Posts
Discussion Starter #1
Somehow .cmd files have become associated with Notepad and just open as regular text files instead of running as a command.

How can I fix this?
 

·
Moderator , - Microsoft Support
Joined
·
7,742 Posts
Hi, DO NOT run sparkit2me"s script it applies to XP and this is the Vista forum it is also not written for your computer it will rename your registered user and owner (among other things) Let us know what OS you have (you have XP showing).
 

·
Administrator, Manager, Microsoft Support, Acting
Joined
·
34,378 Posts
Hi, DO NOT run sparkit2me"s script it applies to XP and this is the Vista forum it is also not written for your computer it will rename your registered user and owner (among other things) Let us know what OS you have (you have XP showing).
I agree w/ jenae and have deleted the post.

jcgriff2

.
 

·
Microsoft MVP
Joined
·
3,339 Posts
  • If this is XP:
    Click Start | Run (or press WinKey+R), type cmd, press Enter
    .
  • If this is Vista/Win 7:
    Click Start, type cmd, when cmd.exe appears in the list, right click it and click Run as administrator.

Once you have the Command Prompt open, copy and paste this line into the Command Prompt, then press Enter
Code:
Reg Delete HKCR\cmdfile\shell /VE /F
To paste into the Command Prompt, right click the Window, click Paste. If Quick Edit is enabled, the right click will paste immediately. (copy the text in the Code box first of course)

If this doesn't fix it we'll have to do some digging.

Does this happen with .bat files as well?
 

·
Moderator , - Microsoft Support
Joined
·
7,742 Posts
Hi Outcaste, I think the problem is the OP cannot open a cmd prompt his file associations are corrupt I know what to do to fix it, just the reg mods for XP, Vista and 7 are different need to know what the op is running.
 

·
Microsoft MVP
Joined
·
3,339 Posts
I suspect you are right. If the Default entry under HKCR\cmdfile\shell is set to none or edit, instead of being undefined as it should be, a double click will open the file in Notepad, but a Right click | Open should still work. If that opens in Notepad then there's more to it then that one entry.

That entry is one that is the same for all NT based versions of Windows, so it's about the only thing to try until we know what OS it is for sure.
 

·
Registered
Joined
·
272 Posts
Discussion Starter #8
Does not happen with .bat files.

I ran the command:
Reg Delete HKCR\cmdfile\shell /VE /F

And received the message:
ERROR: The system was unable to find the specified registry key or value.
 

·
Moderator , - Microsoft Support
Joined
·
7,742 Posts
Hi, for 7 this is the default (full reg setting) copy and paste all below into notepad then in notepad select "file" then "save as" save to desktop and call it CMD.reg. Locate the saved file and double click to merge into registry, reboot to take effect. Thanks to Ramesh for this:-(he appears to have borrowed some of mine)

Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.CMD]
@="cmdfile"

[HKEY_CLASSES_ROOT\.CMD\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\cmdfile]
@="Windows Command Script"
"EditFlags"=hex:30,04,00,00
"FriendlyTypeName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\
  00,6f,00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,\
  32,00,5c,00,61,00,63,00,70,00,70,00,61,00,67,00,65,00,2e,00,64,00,6c,00,6c,\
  00,2c,00,2d,00,36,00,30,00,30,00,33,00,00,00

[HKEY_CLASSES_ROOT\cmdfile\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,69,00,6d,00,\
  61,00,67,00,65,00,72,00,65,00,73,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,36,\
  00,38,00,00,00

[HKEY_CLASSES_ROOT\cmdfile\shell]

[HKEY_CLASSES_ROOT\cmdfile\shell\edit]

[HKEY_CLASSES_ROOT\cmdfile\shell\edit\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\
  54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45,00,20,00,25,00,31,00,00,\
  00

[HKEY_CLASSES_ROOT\cmdfile\shell\open]
"EditFlags"=hex:00,00,00,00

[HKEY_CLASSES_ROOT\cmdfile\shell\open\command]
@="\"%1\" %*"

[HKEY_CLASSES_ROOT\cmdfile\shell\print\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\
  54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45,00,20,00,2f,00,70,00,20,\
  00,25,00,31,00,00,00

[HKEY_CLASSES_ROOT\cmdfile\shell\runas]
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\cmdfile\shell\runas\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,63,00,6d,00,\
  64,00,2e,00,65,00,78,00,65,00,20,00,2f,00,43,00,20,00,22,00,25,00,31,00,22,\
  00,20,00,25,00,2a,00,00,00

[HKEY_CLASSES_ROOT\cmdfile\shell\runasuser]
@="@shell32.dll,-50944"
"Extended"=""
"SuppressionPolicyEx"="{F211AA05-D4DF-4370-A2A0-9F19C09756A7}"

[HKEY_CLASSES_ROOT\cmdfile\shell\runasuser\command]
"DelegateExecute"="{ea72d00e-4960-42fa-ba92-7792a7944c1d}"

[HKEY_CLASSES_ROOT\cmdfile\ShellEx\ContextMenuHandlers]
@="Compatibility"

[HKEY_CLASSES_ROOT\cmdfile\ShellEx\ContextMenuHandlers\Compatibility]
@="{1d27f844-3a1f-4410-85ac-14651078412d}"

[HKEY_CLASSES_ROOT\cmdfile\ShellEx\DropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"

[HKEY_CLASSES_ROOT\cmdfile\ShellEx\PropertySheetHandlers\PifProps]
@="{86F19A00-42A0-1069-A2E9-08002B30309D}"

[HKEY_CLASSES_ROOT\cmdfile\ShellEx\PropertySheetHandlers\ShimLayer Property Page]
@="{513D916F-2A8E-4F51-AEAB-0CBC76FB1AF8}"

[HKEY_CLASSES_ROOT\cmdfile\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}]
@="{1531d583-8375-4d3f-b5fb-d23bbd169f22}"

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.CMD\UserChoice]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.CMD\OpenWithProgids]
"cmdfile"=hex(0):
 

·
Registered
Joined
·
272 Posts
Discussion Starter #11
When I run the CMD.reg file I get the error:
Cannot import: Some keys are open by the system or other processes.

What should I do about this? Do I need to run this in safe mode?
 

·
Moderator , - Microsoft Support
Joined
·
7,742 Posts
Hi, try safe mode although I think you better post over in the security forum to be sure, I don't like the look of that response.
 
1 - 12 of 12 Posts
Status
Not open for further replies.
Top