Jump to content
Sign in to follow this  
richL

trying to run one line at a time

Recommended Posts

richL

Hello,

I am logging into a computer as "user1". I then run the below script with a runas command to run a bat file as "user2":

Line1: $rawReturn=RunAs("user2","domain","password",1,"C:\folder\script.bat",@SystemDir,@SW_MINIMIZE)

Line2: MsgBox(0, "AutoIt Example", "This is line 1" & @CRLF & "This is line 2" & @CRLF & "This is line 3")

Line1 in the script does execute, as well as the Line2. Problem is it is just blowing right through the script. I need a way for it to wait until line 1 is done running (script.bat can take one to five minutes to run) before it proceeds to line 2 (my sample msgbox line). I don't suppose there is a way for autoIT script to wait till that bat file in the first line closes before it moves onto the next line, is there?

-Rich

Share this post


Link to post
Share on other sites
richL

That worked. That's just what I was looking for. Thanks so much!

-Rich

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  

×