List All Assigned Shortcut Keys for Shortcuts on Windows

If you’re not able to assign a particular hotkey combination for a shortcut, then it may have already been registered. But which shortcut is currently using the hotkey, and from which folder path? You can find it out by running the script attached to this article.

This script recursively searches for shortcuts in the Desktop and Start menu (per-user and per-machine locations), Quick Launch, Taskbar – User Pinned & all of their subfolders, and shows the list of shortcuts with hotkey assignments in a popup window as in the image below.

This script has a limitation; it can’t get the hotkeys for .URL (Internet Shortcuts), which I may implement in the future.

So here are the contents of the quick script I came up with, to list shortcut hotkeys.






'File: ListHotKeys.vbs
'Script Info: Obtains the List of Shortcuts With a Hotkey assigned
'Author: Ramesh Srinivasan, for The Winhelponline Blog
'https://www.winhelponline.com/blog/list-all-hotkeys-used-shortcuts-script/
'Created on May 5 2016
'Modified on May 19 2016
'Reviewed on May 22 2021
'URL: https://www.winhelponline.com/blog

Option Explicit
Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim WshShell: Set WshShell = WScript.CreateObject("WScript.Shell")
Dim arrFolders, objFolder, fldr, colfiles, colFolders
Dim objFile, objSubFolder, oShellLink, strHotKey

arrFolders = Array ( _
WshShell.SpecialFolders("AllUsersDesktop") _
, WshShell.SpecialFolders("Desktop") _
, WshShell.SpecialFolders("AllUsersStartMenu") _
, WshShell.SpecialFolders("StartMenu") _
, WshShell.SpecialFolders("AppData") & _
"\Microsoft\Internet Explorer\Quick Launch" _
)

For Each fldr In arrFolders
	If objFSO.FolderExists (fldr) Then Call GetHotKeys (fldr)
Next

Sub GetHotKeys (strFolder)
	Set objFolder = objFSO.GetFolder(strFolder)
	Set colFiles = objFolder.Files
	For Each objFile In colFiles
		If LCase(objFSO.GetExtensionName(objFile.Name)) = "lnk" Then
			Set oShellLink = WshShell.CreateShortcut(objFile.Path)
			If Trim(oShellLink.Hotkey) <> "" Then
				strHotKey = strHotKey & "[" & Trim(oShellLink.Hotkey) & _
				"]" & vbCrLf & objFile.Path & vbCrLf & vbCrLf
			End If
		End If
	Next
	Set colFolders = objFolder.SubFolders
	For Each objSubFolder In colFolders
		GetHotKeys(objSubFolder)
	Next
End Sub

WshShell.PopUp strHotKey,,"Hotkeys Curently in Use by Shortcuts", 65
Set WshShell = Nothing
Set objFSO = Nothing

  • Copy the script contents to Notepad
  • Save the file with the .vbs extension — e.g., ListHotKeys.vbs
  • Double-click the script to view the list of hotkeys currently assigned in your user account.

HotKeysList from Nirsoft

The HotKeysList from Nirsoft lists out all the hotkeys that are assigned currently – via shortcuts, website shortcuts (.url), and also the hotkeys used by the AutoHotKey script(s). However, one shortcoming of this utility is that it doesn’t show the corresponding file name (.LNK, or .URL) of a hotkey.

hotkeyslist

Get HotKeysList from http://www.nirsoft.net/utils/hot_keys_list.html.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

5 thoughts on “List All Assigned Shortcut Keys for Shortcuts on Windows”

  1. This is extremely useful and it’s so delightful to see someone do more with this little used but powerful hotkey functionality of Windows Shell! Thanks!!

    Why not just use WScript.Echo strHotKey instead of dumping it to a text file and opening in Notepad?

    Reply
  2. WScript.Echo or messagebox has it’s own limitation (number of characters, may be). That was the first thing I used, and some items at the end didn’t show up correctly.
    -> WshShell.Popup has no limitation. I’m updating this. Thanks for the idea.

    Reply

Leave a Comment