Enter text into already open program and hit enter

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
bdoeden
Posts: 1
Joined: 18 Jul 2016 14:18

Enter text into already open program and hit enter

#1 Post by bdoeden » 18 Jul 2016 14:30

Hello,
I am not a programmer (unless you count Commodore 64 Basic), but do have some experience with batch files and command line commands. I have been trying to create a batch file that will automatically enter into an open program (eClubLogic) a specific text entry and hit enter every 20 minutes. The program remains open 24/7, but has been having issues with timing out - this is my attempt to keep it from 'going to sleep' on us by having it routinely connect to the server. Thank you in advance for any help you can give me.

I did find the thread below, but don't understand how to get the text to populate in a program that's already open. Can I use a PID?

http://stackoverflow.com/questions/2457 ... mmatically

Thanks, Bob.

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

Re: Enter text into already open program and hit enter

#2 Post by aGerman » 18 Jul 2016 14:46

Windows has no command tool on board that would be able to do so. You could do that using VBScript or JScript. See
https://msdn.microsoft.com/en-us/library/8c6yea83(v=vs.84).aspx
Note: Key strokes are always sent to the window that currently has the keyboard focus!

Regards
aGerman

Post Reply