You are not logged in.

#1 07 May 2015 09:31

Daxter
New Member
Registered: 07 May 2015
Posts: 2

Select a Batch Window and tipe and press enter

Hello i am new here and i am searching for a Command where i can select a window and write a text.

My Programm is startet in a Batchmode and open an CMD. I will restart this programm every 3 hours but before it close i need to put in a command automaticly.

The command is "Save".

i hope you understand my problem.

Offline

#2 07 May 2015 12:39

foxidrive
Member
Registered: 04 Apr 2013
Posts: 339

Re: Select a Batch Window and tipe and press enter

Using a VBS script inside a batch script can emulate keyboard input.

You'd have to provide a good description of the actual code and task to get some scripting help.

Offline

#3 07 May 2015 13:14

Daxter
New Member
Registered: 07 May 2015
Posts: 2

Re: Select a Batch Window and tipe and press enter

Okay i will explain it.

I've start a Batch file which starts a Game(Unturned) in Batchmode. So it opens up a second CMD. This CMD will restart every 3 hours. But before it Restart i need to write in this CMD "Save".
But i cant write that any 3 hours manually. Is there any option to write a Timer and say the CMD that it write in "Save" and close it after that ?

Offline

#4 07 May 2015 13:39

foxidrive
Member
Registered: 04 Apr 2013
Posts: 339

Re: Select a Batch Window and tipe and press enter

We need to see your code.  If your code restarts it every three hours then it already times the session.

Offline

#5 08 May 2015 03:29

Shadow Thief
Member
Registered: 12 Jul 2012
Posts: 205

Re: Select a Batch Window and tipe and press enter

This is definitely going to be a vbscript solution (or maybe powershell if you're into that sort of thing); batch can't interact with windows that are already open. Also, with the need to re-run the script every three hours, that sounds like a job for the Task Scheduler.

Offline

Board footer

Powered by