Sunday, May 8, 2011

How to reset shortcuts (.lnk file) in win7?


Somehow I went to open a shortcut and windows couldn't find the target but instead of pointing the shortcut to the exe it pointed the lnk file handler to the exe, so now all my lnk files are trying to be opened by the borderlands game.

WTF?

I'm guessing I can do it by resetting the .lnk entry in HKEY_CLASSES_ROOT, but I don't know what to set it to.

link|edit|flag

Thank god for system restore points.

I don't know a direct fix, but I'm back up and running.

If you can't fix it with a scapel, try a sledgehammer.

link|edit|flag
2
If you can't fix it with a sledgehammer, you're not hitting it hard enough!Phoshi Jan 7 '10 at 23:03

According to what I have found on several places (like here or there), you can fix this with a registry operation.

  • Create a new text file
  • Paste the following inside

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT.lnk]

[HKEY_CLASSES_ROOT.lnk] @="lnkfile"

[HKEY_CLASSES_ROOT.lnk\ShellEx]

[HKEY_CLASSES_ROOT.lnk\ShellEx{000214EE-0000-0000-C000-000000000046}] @="{00021401-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT.lnk\ShellEx{000214F9-0000-0000-C000-000000000046}] @="{00021401-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT.lnk\ShellEx{00021500-0000-0000-C000-000000000046}] @="{00021401-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT.lnk\ShellEx{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}] @="{00021401-0000-0000-C000-000000000046}"

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

  • Save the file as "Something.reg"
  • Double-click the file

I can't guarantee that it will fix your problem (since I don't have it myself), but having tested this on my current computer, I can tell you at least that this is harmless (and reading the keys which are modified, it seems to indeed restore the behavior for .lnk extensions).

Doug Knox has fixes for this and other similar problems available for download, look for:

LNK (Shortcut) File Association Fix (Restores Default Shortcut Behavior)

link|edit|flag

Save the following into a .reg file, then import into the registry.

Windows Registry Editor Version 5.00  ;LNK file association fix for Windows Vista. ;Updated on April 24, 2007  [HKEY_CLASSES_ROOT\.lnk] @="lnkfile"  [HKEY_CLASSES_ROOT\.lnk\ShellEx]  [HKEY_CLASSES_ROOT\.lnk\ShellEx\{000214EE-0000-0000-C000-000000000046}] @="{00021401-0000-0000-C000-000000000046}"  [HKEY_CLASSES_ROOT\.lnk\ShellEx\{000214F9-0000-0000-C000-000000000046}] @="{00021401-0000-0000-C000-000000000046}"  [HKEY_CLASSES_ROOT\.lnk\ShellEx\{00021500-0000-0000-C000-000000000046}] @="{00021401-0000-0000-C000-000000000046}"  [HKEY_CLASSES_ROOT\.lnk\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}] @="{00021401-0000-0000-C000-000000000046}"  [HKEY_CLASSES_ROOT\.lnk\ShellNew] "Handler"="{ceefea1b-3e29-4ef1-b34c-fec79c4f70af}" "IconPath"=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,73,\   00,68,00,65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,\   31,00,36,00,37,00,36,00,39,00,00,00 "ItemName"="@shell32.dll,-30397" "MenuText"="@shell32.dll,-30318" "NullFile"="" "Command"=-  [HKEY_CLASSES_ROOT\.lnk\ShellNew\Config] "DontRename"=""  [HKEY_CLASSES_ROOT\lnkfile] @="Shortcut" "EditFlags"=dword:00000001 "FriendlyTypeName"="@shell32.dll,-4153" "NeverShowExt"="" "IsShortcut"=""  [HKEY_CLASSES_ROOT\lnkfile\CLSID] @="{00021401-0000-0000-C000-000000000046}"  [HKEY_CLASSES_ROOT\lnkfile\shellex]  [HKEY_CLASSES_ROOT\lnkfile\shellex\ContextMenuHandlers]  [HKEY_CLASSES_ROOT\lnkfile\shellex\ContextMenuHandlers\OpenContainingFolderMenu] @="{37ea3a21-7493-4208-a011-7f9ea79ce9f5}"  [HKEY_CLASSES_ROOT\lnkfile\shellex\ContextMenuHandlers\{00021401-0000-0000-C000-000000000046}] @=""  [HKEY_CLASSES_ROOT\lnkfile\shellex\DropHandler] @="{00021401-0000-0000-C000-000000000046}"  [HKEY_CLASSES_ROOT\lnkfile\shellex\IconHandler] @="{00021401-0000-0000-C000-000000000046}"  [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.lnk\UserChoice] 
link|edit|flag

The extension .lnk is associated with the Lnkfile which is more commonly known as a Shortcut.

To repair the misassociation, open a Command Prompt and type:

assoc.lnk=lnkfile 

Press Enter and you should be good to go.