Jump to content
Sign in to follow this  

Sections running concurrently instead of sequentially

Recommended Posts


     I am still learning this stuff. I am more of a Sys Admin who was put in an "Automation Specialist" role. Thanks to this forum, I am learning fast.

     I created a script that does 3 things: uninstall an old version, install pre-req's for new version, install new version. It installs perfectly but the installed software does not work. I found out from the manufacturer that another step is required. Permissions for a folder created during the "install new version" step need to be adjusted. So, I created an ICACLS statement that appears to work. However, when I put it at the end of my script, it runs concurrently with the install script. Therefore, because the folder in question has not yet been created, it fails. I have a WinWaitClose statement in there but it is ignoring it. Here is what I have, the Install and Change Folder Permissions section are the problem:


; Script Start - Uninstall
Run ("<servername>SoftwareECOct13EC_Uninstall.bat")
WinWait ("EnvisionConnect Maintenance")
WinActivate ("EnvisionConnect Maintenance")
Send ("o")
WinWaitClose ("C:\Windows\System32\cmd.exe")
WinWaitClose ("EnvisionConnect Maintenance")
; PreReq Install
RunAs ("<admin>", "<domain>", "<admin psswrd>", 0, "C:TempECPrerequisiteBundle.exe")
WinWait ("EnvisionConnect Prerequisites Setup", "This will install")
WinActivate ("EnvisionConnect Prerequisites Setup", "This will install")
Send ("!i")
WinWaitClose ("EnvisionConnect Prerequisites Setup", "Setup Progress")
WinActivate ("EnvisionConnect Prerequisites Setup", "Setup Successful")
Send ("!c")
; Install
RunAs ("<admin>", "<domain>", "<admin psswrd>", 0, "C:TempEC Upgrade.bat")
WinWaitClose ("C:\Windows\System32\cmd.exe", "/quiet")
; Change Folder Permissions
RunAs ("<admin>", "<domain>", "<admin psswrd>", 0, "C:TempPermissions.bat")
The EC Upgrade.bat and the Permissions.bat run at the same time! Is it ignoring the last WinWaitClose (in the install section) because that is the second "C:\Windows\System32\cmd" window and it thinks the specified window was already closed? That was my assumption when I added the "/quiet" text but - no change. Any help would be appreciated.
Edited by tuffgong

Share this post

Link to post
Share on other sites

For the install, try removing the WinWaitClose, and change your RunAs to RunAsWait.

√-1 2^3 ∑ π, and it was delicious!

Share this post

Link to post
Share on other sites

Wow, that worked perfectly! Great call. I really appreciate the help! Thanks so much.

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