Page 1 of 1

File association for EXE and LNK fuxxored

Posted: 2005-07-14 03:17pm
by Manus Celer Dei
I recently ran Registry Mechanic, and, after restarting I found that everytime I try to run an EXE, LNK or REG file I got one of those "choose program to open with" dialouges. Restoring from a backup did apparently nothing, and I'm completely lost on how to recreate them. Can anybody help me with this?

Posted: 2005-07-14 04:16pm
by Xon
This is why registry cleaners are a bad bad idea.

Copy & past this into a new text file and name it "regedit.reg" Double click on it and then when the "choose program to open with" dialog comes up browse to "c:\windows\regedit.exe".
This will restore the .reg assocation:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.reg]
@="regfile"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\regfile]
@="Registration Entries"
"EditFlags"=dword:00100000

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\regfile\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,72,00,65,00,67,00,65,00,64,00,69,00,74,00,2e,00,65,00,78,00,65,00,\
  2c,00,31,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\regfile\shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\regfile\shell\edit]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\regfile\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,73,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_LOCAL_MACHINE\SOFTWARE\Classes\regfile\shell\open]
@="Mer&ge"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\regfile\shell\open\command]
@="regedit.exe \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\regfile\shell\print]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\regfile\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,73,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
Now for .lnk

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.lnk]
@="lnkfile"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.lnk\ShellNew]
"Command"="rundll32.exe appwiz.cpl,NewLinkHere %1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\lnkfile]
@="Shortcut"
"EditFlags"=dword:00000001
"IsShortcut"=""
"NeverShowExt"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\lnkfile\CLSID]
@="{00021401-0000-0000-C000-000000000046}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\lnkfile\shellex]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\lnkfile\shellex\DropHandler]
@="{00021401-0000-0000-C000-000000000046}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\lnkfile\shellex\IconHandler]
@="{00021401-0000-0000-C000-000000000046}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\lnkfile\shellex\PropertySheetHandlers]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\lnkfile\shellex\PropertySheetHandlers\ShimLayer Property Page]
@="{513D916F-2A8E-4F51-AEAB-0CBC76FB1AF8}"
exe:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.exe]
@="exefile"
"Content Type"="application/x-msdownload"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.exe\PersistentHandler]
@="{098f2470-bae0-11cd-b579-08002b30bfeb}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile]
@="Application"
"EditFlags"=hex:38,07,00,00
"TileInfo"="prop:FileDescription;Company;FileVersion"
"InfoTip"="prop:FileDescription;Company;FileVersion;Create;Size"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\DefaultIcon]
@="%1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shell\open]
"EditFlags"=hex:00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shell\open\command]
@="\"%1\" %*"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shell\runas]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shell\runas\command]
@="\"%1\" %*"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shellex]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shellex\DropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shellex\PropertySheetHandlers]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shellex\PropertySheetHandlers\PifProps]
@="{86F19A00-42A0-1069-A2E9-08002B30309D}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shellex\PropertySheetHandlers\ShimLayer Property Page]
@="{513D916F-2A8E-4F51-AEAB-0CBC76FB1AF8}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shellex\PropertySheetHandlers\{B41DB860-8EE4-11D2-9906-E49FADC173CA}]
@=""

Posted: 2005-07-14 04:45pm
by Manus Celer Dei
That worked perfectly. Danka!

I'm sure as helll not gonna be using any regcleaners anytime soon.

Posted: 2005-07-15 04:52pm
by Vertigo1
What you can also do (works for 9x and up) is open an explorer window (NOT talking about Internet Explorer here...). Click on the Tools menu and select Folder Options. Click on the File Types tab and scroll down to the offending extention. Click the default button and hit OK. Do the same for each, and hit apply. Then restart windows.

Posted: 2005-07-15 07:25pm
by Exonerate
Ah... That reminds me of this time a friend accidentally changed the file assocation for .exe files. So he couldn't even run regedit (.exe) to rectify his problem and had to reformat.

Moral of the story is don't mess around with the registry unless you know what you're doing. Always make backups.

Posted: 2005-07-16 06:22am
by DaveJB
Destructionator XIII wrote:Surely if that happened he still could have called regedit from the command line, right?
Probably not, considering that to access the command line you need to run "cmd.exe"