I have a very basic VBS script that I plan on using frequently on my Windows 7 machine. Is there any way I can bind it to a keyboard shortcut so I don't have to navigate to it through Explorer obnoxiously.
I realize this question does not directly pertain to programming, or even scripting for that matter, but I could not find a straight answer online or through my own experimentation. I'm sure that there is a simple solution somewhere...
Thank you for taking the time to read, and hopefully respond to my inquiry. Evin Ugur.
Create shortcuts on desktop with Visual Basic ScriptInsert VBScript lines by Copy Paste into Notepad and save them as create-shortcut. vbs , then douple-click to execute the VBScript will create the shortcut on desktop. Last but not least, enjoy to edit the Const lines in the script to use any other applications.
To reassign a keyConnect the keyboard that you want to configure. Select the Start button, and then select Microsoft Mouse and Keyboard Center. From the displayed list of key names, select the key that you want to reassign. In the command list of the key that you want to reassign, select a command.
Go to the Shortcut tab, click inside the 'Shortcut key' field, and record the keyboard shortcut that you want to use to run the app. You only need to enter a letter or number. The Ctrl+Alt keys are added by default and will be part of all keyboard shortcuts for running apps/shortcuts to apps. That should do the trick.
Windows does have built-in support for shell shortcut keys, where a keypress is used to invoke an *.lnk
file that launches your VBScript (using either cscript or wscript).
Create a shortcut file, have it invoke your VBScript file directly or run cscript or wscript with the appropriate arguments, then save it and open its Properties sheet and set a keystroke in the "Shortcut key" field (I suggest something like Ctrl+Alt+K).
Like so:
Then, whenever you press Ctrl+Alt+K, regardless of the active application, your script will be invoked.
A more heavy-duty alternative is AutoHotKey: http://www.autohotkey.com/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With