richL Posted April 28, 2010 Share Posted April 28, 2010 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 More sharing options...
l3ill Posted April 28, 2010 Share Posted April 28, 2010 (edited) RunAsWait or RunWait didnt work? Edited April 28, 2010 by billo My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
richL Posted April 28, 2010 Author Share Posted April 28, 2010 That worked. That's just what I was looking for. Thanks so much! -Rich Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now