Page 1 of 1

Automate the keys "win+shift+rightarrow"

Posted: 13 Nov 2012 06:27
by g4m8l3r
Hi Guys, I am completely new to creating "batch" files, basicly I need to send a active window to a extended display using some sort of command, I was thinking of having a command that would manualy input the keys "win+shift+rightarrow" could you tell me what would be the best option.

Kind Regards

Re: New Here Help Please!!

Posted: 13 Nov 2012 06:49
by Squashman

Re: New Here Help Please!!

Posted: 13 Nov 2012 08:25
by g4m8l3r
Not trying to be lazy or anything here but is there anything done already that I can try? I cant use any 3rd party software either.

Re: New Here Help Please!!

Posted: 13 Nov 2012 08:35
by foxidrive
g4m8l3r wrote:Not trying to be lazy or anything here but is there anything done already that I can try? I cant use any 3rd party software either.


Batch files can't do it without other tools. Using Send keys is a possibility, and using batch to wrap the VB script in.

If you can't use 3rd party tools then VB scripts may be locked down too.

Re: New Here Help Please!!

Posted: 13 Nov 2012 08:41
by g4m8l3r
Basicly I have the option to run something from software that will be in use, I cant install anything else it has to be standalone.
I am running out of ideas :(

Re: Automate the keys "win+shift+rightarrow"

Posted: 13 Nov 2012 09:12
by g4m8l3r
I need it to switch to a particular active window then send the following keystrokes "win+shift+rightarrow"

Re: Automate the keys "win+shift+rightarrow"

Posted: 13 Nov 2012 09:51
by foxidrive
Send Keys can probably do that. You have to leave the keyboard/mouse alone while it does it.

If you can run VB scripts using Windows Scripting Host then do a google search for a sendkeys example.

EDIT: Sendkeys cannot send the Windows key, from the documentation I have. Is there another keyboard set of keystrokes that will do this?

Re: Automate the keys "win+shift+rightarrow"

Posted: 14 Nov 2012 05:29
by g4m8l3r
no sorry I need to use that set of keys, I am trying to use Win Automation to achieve this but not getting very far.

Re: Automate the keys "win+shift+rightarrow"

Posted: 14 Nov 2012 09:36
by timbertuck
will this help you out, comes from microsoft

The Microsoft Keyboard Layout Creator
http://msdn.microsoft.com/en-us/goglobal/bb964665.aspx

appears to be standalone, you will need to have .NET installed to make it work.

you might also look into this http://www.randyrants.com/sharpkeys/

edit: You can also look for the resource kit for your windows installation and find Remapkey.exe: "Remap Windows Keyboard Layout"
there should be no reason why you can't download and install a valid Microsoft Resource Kit...

Re: Automate the keys "win+shift+rightarrow"

Posted: 14 Nov 2012 12:47
by Boombox
.
Yeah. I'm stuggling to get this to work with Vb. But I'm sure it can be done.

If you have Win7, you can activate extended desktop, then launch an app...

Code: Select all

DisplaySwitch.exe /external
calc.exe


But not sure how much help that is....

Will keep you posted on the Vb script.

More DisplaySwitch;

Extend Display
DisplaySwitch.exe /extend

2nd monitor
DisplaySwitch.exe /external

Computers Monitor
DisplaySwitch.exe /internal

Duplicate Display
DisplaySwitch.exe /clone