Batch file for keystroke

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
batchthebitch
Posts: 3
Joined: 03 Jun 2017 03:33

Batch file for keystroke

#1 Post by batchthebitch » 03 Jun 2017 03:46

Can some good angel make me a batch file that simulates keystrokes?
That acts as if I had hit ALT+F11

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch file for keystroke

#2 Post by aGerman » 03 Jun 2017 06:30

There is no possibility using pure batch. Other Windows scripting languages (like PowerShell, VBScript, JScript) are able to send keystrokes to the window that currently has the keyboard focus.

Steffen

batchthebitch
Posts: 3
Joined: 03 Jun 2017 03:33

Re: Batch file for keystroke

#3 Post by batchthebitch » 03 Jun 2017 07:19

Thanks!
Maybe someone can give me a VBScript file for this?

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch file for keystroke

#4 Post by aGerman » 03 Jun 2017 08:15

Meanwhile you would have found thousands of examples in the internet. Never mind.

*.vbs

Code: Select all

WScript.CreateObject("WScript.Shell").SendKeys "%{F11}"

Manpage

Steffen

batchthebitch
Posts: 3
Joined: 03 Jun 2017 03:33

Re: Batch file for keystroke

#5 Post by batchthebitch » 04 Jun 2017 01:29

Thanks!
I did find one, but anyway...

Post Reply