Tom Hopes
Tom Hopes

Reputation: 1

vbscript SendKey

I have a process I need to run which can only be run by shortcut keys which are CTRL+ALT+RIGHT SHIFT

To make it easier for users I would like to create a desktop shortcut to click on to run this shortcut.

The way I thought this could be done is by vbs script sendkey.

Am I right in my research to say that right shift key can not be specified?

I know there is ^% for CTRL and ALT and + for generic shift but that does not work for right shift.

Is there a way for me to do this?

Upvotes: 0

Views: 1665

Answers (2)

Geert Jan
Geert Jan

Reputation: 428

I use my own open source software "sendkeys v0.0.1" for this. You can compile it as a C# console application in Visual Studio 2013.

Source: Sendkey v0.0.1

Then use it in a command window like this:

 Sendkey CONTROL down
 Sendkey MENU down
 Sendkey RSHIFT down
 Sendkey CONTROL up
 Sendkey MENU up
 Sendkey RSHIFT up

Or in vbscript using the .Exec() method.

(N.B. command window is Microsoft slang for 'terminal' or 'console')

Upvotes: 1

Jay
Jay

Reputation: 57919

I recommend that you use AutoHotkey.

It has a very robust, proven "sendkey" functionality, including the ability to send right shift.

Your script would simply be:

SendInput,^!{RSHIFT}

Furthermore, it comes with a utility that will compile the script into a .exe, which is what you'd want to use on the desktop.

Upvotes: 2

Related Questions