How to set up keyboard shortcuts from windows comm

2019-08-17 04:52发布

I want to create a batch file to assign keyboard shortcuts.

For example, how can I launch Internet Explorer using the key Alt+5?

2条回答
爷、活的狠高调
2楼-- · 2019-08-17 05:36

using NirCmd
http://www.nirsoft.net/utils/nircmd.html
you can create files shortcuts, and assign an hot key to these file shotrcut

See here the help of NirCmd:
http://www.nirsoft.net/utils/nircmd2.html#using

shortcut [filename] [folder] [shortcut title] {arguments} {icon file} {icon resource number} {ShowCmd} {Start In Folder} {Hot Key}
Creates a shortcut to a file.
The parameters:

    [filename]: Create a shortcut to this filename.
    [folder]: Specify the destination folder that inside it the shortcut will be created. You can specify any valid folder, including the special variables that represent system folders, like ~$folder.desktop$ (Desktop folder), ~$folder.programs$ (Start-Menu-Programs folder), and so on...
    [shortcut title]: The text displayed in the shortcut.
    {arguments}: Optional parameter - Additional arguments to execute the filename.
    {icon file}: Optional parameter - Use this parameter if your want that the shortcut will be displayed with icon other than the default one.
    {icon resource number}: Optional parameter - The resource number inside the icon file.
    {ShowCmd}: Optional parameter - Use this parameter if you want to maximize or minimize the window of the program. Specify "max" to maximize the window or "min" to minimize it.
    {Start In Folder}: Optional parameter - Specifies the "Start In" folder. If you don't specify this parameter, the "Start In" folder is automatically filled with the folder of the program you specify in [filename] parameter.
    {Hot Key}: Optional parameter - Specifies an hot-key that will activate the shortcut. For example: Alt+Ctrl+A, Alt+Shift+F8, Alt+Ctrl+Shift+Y 


Examples:
shortcut "f:\winnt\system32\calc.exe" "~$folder.desktop$" "Windows Calculator"
shortcut "f:\winnt\system32\calc.exe" "~$folder.programs$\Calculators" "Windows Calculator"
shortcut "f:\Program Files\KaZaA\Kazaa.exe" "c:\temp\MyShortcuts" "Kazaa"
shortcut "f:\Program Files" "c:\temp\MyShortcuts" "Program Files Folder" "" "f:\winnt\system32\shell32.dll" 45
shortcut "f:\Program Files" "c:\temp\MyShortcuts" "Program Files Folder" "" "" "" "max" 
查看更多
老娘就宠你
3楼-- · 2019-08-17 05:44

1) Create a shortcut to Internet Explorer, and place it on the Desktop.
2) Right-Click the shortcut and then click Properties
3) Click in the box next to Keyboard Shortcut.
4) Press ALT+5 (The box will display CTRL+ALT+5)
5) Click -> OK

It is important to keep the shortcut on your Desktop or Start Menu*, otherwise it won't work.
AFAIK you must create a CTRL+ALT+? shortcut with this method.

*Edited to include Andriy M's point about the Start Menu.

查看更多
登录 后发表回答