# Solved: Batch File Help



## Newrad0603 (Jul 23, 2007)

I am writing a dos batch file that opens an executable file.

First I want to know if there is a way to use keyboard scan codes to automatically perform some actions in the executable.

I want the computer to automatically execute a set of keystrokes, so the user doesn't 
have to. To be more specific, when dos opens the .exe file I want the computer to
think that some has hit SHIFT+TAB, ARROWDOWN, TAB, TAB, ENTER

Then I want to have the program automatically close when it is finished.

Thanks for the help


----------



## Squashman (Apr 4, 2003)

AutoIT to the rescue.
http://www.autoitscript.com/autoit3/


----------



## JohnWill (Oct 19, 2002)

Darn, beat me to it.


----------



## Newrad0603 (Jul 23, 2007)

I want to know if there is a way to do it using dos code, if you don't mind.


----------



## dez_666 (May 30, 2007)

You could probably do it in C++


----------



## Squashman (Apr 4, 2003)

Well if you want to do it the hard way all you had to do was Google Search.
http://www.ericphelps.com/batch/samples/sendkeys.txt

And this guy was trying to do the same thing you are but decided AutoIT did it much better.
http://www.winforums.com/showthread.php?t=10611

And here is a Quote from Rob Vanderwoude who knows just about everything when it comes to batch files.
http://www.robvanderwoude.com/batutils.html


> A real FRQ (Frequently Recurring Question) is about sending key strokes to Windows GUI style programs. I'm sorry to tell you it cannot be done in batch language itself!
> But do not despair yet, Jonathan Bennett's AutoIt and Chris Mallett's AutoHotkey to the rescue...


----------



## ghostdog74 (Dec 7, 2005)

Newrad0603 said:


> I want to know if there is a way to do it using dos code, if you don't mind.


in DOS, no. BUT, without any third party installations, the next best thing to DOS is vbscript.
See here for examples


----------



## Newrad0603 (Jul 23, 2007)

Thanks for all the help, I have it all worked out.


----------



## Squashman (Apr 4, 2003)

And your solution was????????????


----------



## Newrad0603 (Jul 23, 2007)

I used vbscript


----------

