2

Context

In Windows, it's possible to assign a keyboard shortcut to an application via the "Properties" dialog's "Shortcut" tab.

enter image description here

Image source.

Problem

I had a "Shortcut key" set for an application. But ever since the company's IT replaced my work computer, that application isn't installed anymore.

I'd like to assign the previously used shortcut key to a new application. But it's not accepting the shortcut key, probably because it is, or rather was, already assigned to a application. Even though I have a new computer, I'm using the same Windows profile.

Usually, I'd just delete the shortcut key from the first application to be able to assign it to a new application. I've done that before and it works that way.

But because the old application isn't installed anymore, I can't do that. And even now that the old application is uninstalled, it seems like the shortcut key is somewhere registered as "in use".

Note that it is possible to assign a new shortcut key. I just can't assign any shortcut keys that are already assigned to other applications, including the one that was assigned to the deleted application.

Question

How can I reset one or perhaps all shortcut keys, so I can reuse them for new applications?

Are they stored in some configuration file? Could I tweak such a settings file? Windows registry keys perhaps?

  • Is there a problem deleting the shortcut file itself? – Alex Feb 9 '15 at 9:32
  • @Alex: No, there isn't. I can delete it and recreate it. But the shortcut key assignment still doesn't work. I can assign an unused shortcut key though. – Lernkurve Feb 9 '15 at 9:34
1

You could try to find out which shortcut has reserved the shortcut key. You can list all the details of a shortcut file with this script:

' shortcut_info.vbs
' http://www.robvanderwoude.com/vbstech_shortcuts.php
' Author: Denis St-Pierre
' *Retrieves* Shortcut info without using WMI 
' The *Undocumented* Trick: use the ".CreateShortcut" method without the 
' ".Save" method; works like a GetShortcut when the shortcut already exists!
' 
' 9.2.2015: The WScript.arguments feature added by Ciove. 

set objArguments = WScript.arguments
strTargetPath=objArguments(0)

Set wshShell    = WScript.CreateObject("WScript.Shell")
' CreateShortcut works like a GetShortcut when the shortcut already exists!
Set objShortcut = wshShell.CreateShortcut(strTargetPath)

' For URL shortcuts, only ".FullName" and ".TargetPath" are valid
WScript.Echo "Full Name         : " & objShortcut.FullName
WScript.Echo "Arguments         : " & objShortcut.Arguments
WScript.Echo "Working Directory : " & objShortcut.WorkingDirectory
WScript.Echo "Target Path       : " & objShortcut.TargetPath
WScript.Echo "Icon Location     : " & objShortcut.IconLocation
WScript.Echo "Hotkey            : " & objShortcut.Hotkey
WScript.Echo "Window Style      : " & objShortcut.WindowStyle
WScript.Echo "Description       : " & objShortcut.Description

Set objShortcut = Nothing
Set wshShell    = Nothing

To list all shortcuts to a shortcut_info.txt -file, open command prompt (WindowsButton+R, cmd, Enter) and use these commands:

:: List your useraccount's  shortcuts.
FOR /R %USERPROFILE% %a IN (*.lnk) DO cscript //nologo c:\your\path\to\shortcut_info.vbs "%~a" >>shortcut_info.txt
:: List the shortcuts common to all users of this computer. 
FOR /R %PUBLIC% %a IN (*.lnk) DO cscript //nologo c:\your\path\to\shortcut_info.vbs "%~a" >>shortcut_info.txt

This example has been tested with windows 7.

  • Pretty cool. :-) However, it didn't find the hotkey I am looking for because the link does not exist anymore. It found all the other hotkeys, though. Hm... :-/ – Lernkurve Feb 9 '15 at 10:25
  • Thanks, this worked for me! If you know the program to which the hotkey links, you can just search for its name in the .txt file. – Josh Friedlander Apr 20 '17 at 15:11
1

I had a very similar problem that I've just resolved. Use the script posted in Ciove's answer, with one small change in how it's run:

:: List all the shortcuts, everywhere 
FOR /R "C:\" %a IN (*.lnk) DO cscript //nologo "c:\your\path\to\shortcut_info.vbs" "%~a" >>shortcut_info.txt

The only change I made is that instead of looking in specific folders, I let the script scan my entire drive. This does give you a much larger file to dig through, but a regex search with "Hotkey : .+" can make quick work of that. My phantom shortcut was in [user folder]\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\ which isn't a location I've seen mentioned in any other article about hotkeys. (Maybe you could just look there first?)

I used this to remove a shortcut given to a program that Windows transitioned to an App in Windows 10.

0

I used RJL Shortcut Key Explorer SW when I had the same issues. I am not endorsed by them, I simply like quick GUI solutions sometimes. I think I uploaded mine to virustotal.com beforehand too & it came out okay

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.