I am logging into a network share through a batch script to start a test I can get the shared program logged in but then up comes the windows prompt "run" or "cancel". Not all of the machines have this prompt.

How can I automatically choose 'run' from this prompt so the rest of the script can run?

Jake

link|improve this question
feedback

1 Answer

Try using AutoIt to run your batch file. It can watch for windows by title or window handle and send keystrokes/mouse clicks as needed.

link|improve this answer
Actually the script is part of a larger AutoIT script. I use the AutoIT to run commands in the program that is called. My issue is that if I do get AutoIT to hit Run it doesn't come up on every machine so I am currently just using window position and a click. Can I code an If into AutoIT to check whether the window comes up then click? – Jake Rue Apr 21 '10 at 5:37
Yes, you should be able to set a timeout to look for that window (by title or handle) and if it doesn't come up within that specified period just continue. It's been awhile since I've used AutoIt so I can't give you exact syntax, but it should be pretty straightforward. Sloppy pseudocode: loop(exit when count=10); if(window exists) click Run; else wait 1s; count++; end loop; – dosboy Apr 21 '10 at 5:58
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.