Automate the keys "win+shift+rightarrow"

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
g4m8l3r
Posts: 5
Joined: 13 Nov 2012 06:24

Automate the keys "win+shift+rightarrow"

#1 Post by g4m8l3r » 13 Nov 2012 06:27

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

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: New Here Help Please!!

#2 Post by Squashman » 13 Nov 2012 06:49


g4m8l3r
Posts: 5
Joined: 13 Nov 2012 06:24

Re: New Here Help Please!!

#3 Post by g4m8l3r » 13 Nov 2012 08:25

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.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: New Here Help Please!!

#4 Post by foxidrive » 13 Nov 2012 08:35

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.

g4m8l3r
Posts: 5
Joined: 13 Nov 2012 06:24

Re: New Here Help Please!!

#5 Post by g4m8l3r » 13 Nov 2012 08:41

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 :(

g4m8l3r
Posts: 5
Joined: 13 Nov 2012 06:24

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

#6 Post by g4m8l3r » 13 Nov 2012 09:12

I need it to switch to a particular active window then send the following keystrokes "win+shift+rightarrow"

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

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

#7 Post by foxidrive » 13 Nov 2012 09:51

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?

g4m8l3r
Posts: 5
Joined: 13 Nov 2012 06:24

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

#8 Post by g4m8l3r » 14 Nov 2012 05:29

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.

timbertuck
Posts: 76
Joined: 21 Dec 2011 14:21

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

#9 Post by timbertuck » 14 Nov 2012 09:36

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...

Boombox
Posts: 80
Joined: 18 Oct 2012 05:51

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

#10 Post by Boombox » 14 Nov 2012 12:47

.
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

Post Reply