How to reset shortcuts (.lnk file) in Windows 7?

40

23

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.

What's going on?

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.

Joel Barsotti

Posted 2010-01-07T22:39:12.690

Reputation: 730

hunkid0ry's answer below fixed the problem immediately -- no reboot, no logout/login -- and is one step – just mike – 2018-03-15T15:28:00.803

Answers

28

Open regedit from the Start Menu (You can also invoke the file using Run command).
Navigate to the following registry branch:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.lnk

Click on the arrow to expand it and delete the sub-key named UserChoice. Exit from Registry Editor.

After this do a reboot.

Sun

Posted 2010-01-07T22:39:12.690

Reputation: 296

1This answer is correct if it was only the user's preference that was affected. Otherwise, the HKEY_CLASSES_ROOT.lnk registry key will need to be rebuilt, as mentioned in another answer. – Nathan Hartley – 2014-07-17T23:15:51.270

I navigated to "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.lnk" please note the \ in the end. This is what I see link to three screenshots. Should I delete allt hat are not Named "(Default)"?

– user1603548 – 2014-10-09T14:25:00.073

2There is a similar question on the Microsoft KB and their solution doesn't work! This answer is better than theirs! =) – thiagolr – 2015-07-16T21:39:49.910

Or just log off and then back in. No reboot is required for this. – mrTomahawk – 2015-09-01T10:26:25.710

5You can even restart explorer.exe instead of rebooting. – Guillaume Chevalier – 2014-05-27T17:20:41.350

25

Follow these steps to save the Registry code below into a .reg file then import it into the Registry:

  1. Open Notepad
  2. Copy and paste the Registry code below into the Notepad window
  3. Save the file to your Desktop with the name fixshortcuts.reg
  4. On your Desktop open fixshortcuts.reg and merge the file into the Registry
  5. Log off and back on to make the changes take effect

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]

Mukesh9871

Posted 2010-01-07T22:39:12.690

Reputation: 251

Got the message

"The specified file is not a registry script. You can only import binary registry files from within the registry editor."

I createt a txt file in C:/Users/jl/ and pasted the code and renamed the file to .reg – user1603548 – 2014-10-09T14:15:57.360

1You saved my day ! – Jsncrdnl – 2015-04-30T12:04:06.403

2That is amazing. You are amazing. It worked like a charm. (After I logged off and on again). – Robin Winslow – 2012-10-23T13:55:35.547

11

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.

hunkid0ry

Posted 2010-01-07T22:39:12.690

Reputation: 111

1That worked instantly to repair damage left behind by malware – ppostma1 – 2014-08-26T14:20:38.083

This is a great tip, I'd buy you a beer/coffee if I could. – Tensigh – 2017-02-06T02:12:13.457

You the star for the day 100% worked for me – humphrey – 2013-04-18T08:40:18.437

8

A system restore to before the problem started will fix it, and likely any other file association changes.

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 scalpel, try a sledgehammer.

Joel Barsotti

Posted 2010-01-07T22:39:12.690

Reputation: 730

10If you can't fix it with a sledgehammer, you're not hitting it hard enough! – Phoshi – 2010-01-07T23:03:49.880

0

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).

Gnoupi

Posted 2010-01-07T22:39:12.690

Reputation: 7 909