Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question

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.

share|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; – ggutenberg Apr 21 '10 at 5:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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