如何重置 Windows 应用程序的“快捷键”?

如何重置 Windows 应用程序的“快捷键”?

语境

在 Windows 中,可以通过“属性”对话框的“快捷方式”选项卡为应用程序分配键盘快捷键。

在此处输入图片描述

图片来源

问题

我曾为某个应用程序设置过“快捷键”。但自从公司 IT 部门更换了我的办公电脑后,该应用程序就不再安装了。

我想将之前使用的快捷键分配给新应用程序。但它不接受该快捷键,可能是因为它已经分配给应用程序了。尽管我有一台新电脑,但我使用的是相同的 Windows 配置文件。

通常,我只需从第一个应用程序中删除快捷键即可将其分配给新应用程序。我以前这样做过,效果就是这样的。

但因为旧应用程序不再安装,所以我无法这样做。即使现在旧应用程序已被卸载,快捷键似乎仍在某处注册为“正在使用”。

请注意,可以分配新的快捷键。我只是无法分配已分配给其他应用程序的任何快捷键,包括已分配给已删除应用程序的快捷键。

问题

我如何重置一个或所有快捷键,以便可以在新的应用程序中重新使用它们?

它们存储在某个配置文件中吗?我可以调整这样的设置文件吗?也许是 Windows 注册表项?

答案1

您可以尝试找出哪个快捷方式保留了快捷键。您可以使用此脚本列出快捷方式文件的所有详细信息:

' 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

要列出 Shortcut_info.txt 文件的所有快捷方式,请打开命令提示符(WindowsButton+R、cmd、Enter)并使用这些命令:

:: 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

此示例已在 Windows 7 上测试过。

答案2

我遇到了一个非常相似的问题,刚刚解决了。使用 Ciove 的答案中发布的脚本,并在运行方式上做一个小改动:

:: 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

我所做的唯一更改是,我不再查看特定文件夹,而是让脚本扫描整个驱动器。这确实会给你一个更大的文件需要挖掘,但使用“Hotkey : .+”的正则表达式搜索可以快速完成这项工作。我的幻影快捷方式位于 [用户文件夹]\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\ 中,我在其他有关热键的文章中没有看到提到这个位置。(也许你可以先看看那里?)

我用它来删除 Windows 10 中转换为应用程序的程序的快捷方式。

答案3

我用了RJL 快捷键资源管理器当我遇到同样的问题时,我使用过 SW。他们并不认可我,我只是有时喜欢快速的 GUI 解决方案。我想我之前也把我的上传到 virustotal.com 并且结果还不错。

相关内容