Sign in to follow this  
Followers 0
amcasperforu

Is it possible to autoscript batch file

3 posts in this topic

Hi guys,

I'm wondering if I can use autoit and have a script to automate the answers for my batch file? I have this batch file that minitors some of the events and I have to press key but of course it depends on when a particular service its checking is done... So I cant say the correct timing when its done here;s an example

checking service1

..............................

.............................

............................

<press Enter key for the next service to check> {This requires user intervention cant identify the timing when this one will appear}

checking service2

...........................

..........................

..........................

..........................

.........................

<press Enter key for the next service to check> {This requires user intervention cant identify the timing when this one will appear}

on so on....

Is there a way I can use a condition that check if the statement inside the command prompt says "press Enter key for the next service to check" ? Like if myvariable = "to this statement" then Send("{Enter}")

?????

Please help.

Thanks,

Casper

Share this post


Link to post
Share on other sites



Hi guys,

I'm wondering if I can use autoit and have a script to automate the answers for my batch file? I have this batch file that minitors some of the events and I have to press key but of course it depends on when a particular service its checking is done... So I cant say the correct timing when its done here;s an example

checking service1

..............................

.............................

............................

<press Enter key for the next service to check> {This requires user intervention cant identify the timing when this one will appear}

checking service2

...........................

..........................

..........................

..........................

.........................

<press Enter key for the next service to check> {This requires user intervention cant identify the timing when this one will appear}

on so on....

Is there a way I can use a condition that check if the statement inside the command prompt says "press Enter key for the next service to check" ? Like if myvariable = "to this statement" then Send("{Enter}")

?????

Please help.

Thanks,

Casper

Please help...

Share this post


Link to post
Share on other sites

Try using StdoutRead(). Run the batch file as a child process and since you made it check for

<press Enter key for the next service to check> {This requires user intervention cant identify the timing when this one will appear}

and when it's up send enter. Here's a bit of an example (not full)

If StdoutRead($PID,True) = "<press Enter key for the next service to check> {This requires user intervention cant identify the timing when this one will appear}" Then
              Send("{ENTER}")
EndIf
and add that to your while loop. Hope this helps

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0