1.

Solve : Need to create a simple batch. Any help??

Answer»

Hi,

I am running a programme at work and it requires me to press the F6 key followed by the F10 key over and over again. There is a delay of 5 seconds between each press. I was WONDERING if anyone knows a way that i could automate this. I'd imagine it would be quite easy using a batch file. I have no experience with batches. All my programming experience is with C#, VB etc.

Any help would be MUCH appreciated.

DonalActually, it would be impossible with a Batch file.
Batch Files cannot SEND keystrokes.

You can do this THOUGH. Go to Notepad and paste the following:
Code: [Select]Set objShell = CreateObject("WScript.Shell")
Wscript.Sleep 2000
For i = 1 to 5
objShell.SendKeys "{F6}"
Wscript.Sleep 100
objShell.SendKeys "{F10}"
Wscript.Sleep 5000
nextGo to File --> Save As... --> file.vbs and press Enter.

Note:
For i = 1 to 5 means this script will repeat 5 times.



Discussion

No Comment Found