Jump to content

trying to run one line at a time


 Share

Recommended Posts

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

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...