Jump to content

Is it possible to autoscript batch file


Recommended Posts

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

Link to comment
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...

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...