Adding Keyboard Shortcuts In Windows

The other day a thought crossed my mind. Could I setup the scripts I wrote to be triggered by keyboard shortcuts? After a little research it turns out yes this is very easy to do in Windows. But there are some limitations.

For this example I will use the text-to-voice script I made in the past. But in theory this could be used for any file or program on your computer.

Making a shortcut file

Make your shortcut by right clicking and then click “Create shortcut” or “Send To > Desktop” on the script or whatever you want your keyboard shortcut to point to.

Create shortcut

The main limitation is the need for a shortcut file and if you move the shortcut it sometimes breaks the keyboard shortcut. The best that I can tell it has to stay in the user profile. Maybe this is a security thing.

Setup the keyboard shortcut keys

Now you right click the new shortcut and go to properties.

In here I set the shortcut key to Ctrl+Alt+T by clicking in the shortcut key field and pushing T on the keyboard.

Shortcut key

For a script you will have to change the target field to something that will work. For PowerShell it’s something like:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file "C:\Users\username\Desktop\Scripts\TextToVoice.ps1"

Test your keyboard shortcuts

Now give your shortcut key a test and see if it works.

If it did not work it might be because of the location your file or shortcut is in. I noticed for me when I was testing that things did not work in the root of the C: drive but inside my user profile folders they seem to work fine.

Testing your keyboard shortcuts

Enjoy!

It’s simple to setup and I find it very handy at times. I hope it helps you too!

Leave a Reply

Your email address will not be published. Required fields are marked *