# Running multiple exe through Auto IT

## Recommended Posts

Experts,

I created an Auto IT package for running multiple packages .

RunWait("abc.exe" )

RunWait("def.exe" )

When i run this scrpit both exe files are getting installed same time but i dont want it as it creates issues.

Please suggest what should i need to so that abc.exe installs completely then def.exe Starts installs.

I dont want to use delay command in between because iam not sure about time taken for abc.exe installatiom.

Please suggest ,it would be of great help.

##### Share on other sites

Welcome to AutoIt and the forum!

RunWait waits until the started process ends. Then AutoIt processes the next statement.

This works fine until abc.exe starts a new process and then returns immediately (this is the case when abc.exe needs administrator permissions).

Only solution I can think of is to wait until no abc.exe process exists any longer.

RunWait("\abc.exe")
While 1
If Not ProcessExists("abc.exe") Then ExitLoop
WEnd
RunWait("\def.exe")

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:

##### Share on other sites

However after doing this also two Installations are executing parrlely but with some delay.

The First installation takes about 1 hour so after 45 min itself second installation starting and creating issues.

Any thought ?

Once again thanks for your help

##### Share on other sites

Does the first installation start a new process with a different name after 45 minutes?

Is there a file, registry key or whatever that tells you that the first installation has finished?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:

##### Share on other sites

Hi

No ,45 min i just gave example.sometime it is staring after 10 min or 15 min,sometimes 30 min.

I dont think new process is strating.

But after run the script ,and in Task manager i can see this process reunning

nameofthescript.exe

and setup.exe *32

RunWait("abc.exe")

While 1

If Not ProcessExists("abc.exe") Then ExitLoop  ,Do i need to Put setup.exe *32 here???

WEnd

RunWait("def.exe")

and also at the same time i can see def.exe

##### Share on other sites

Who starts Setup.exe?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:

##### Share on other sites

When i run the script ,

RunWait("D:Batfileinstallation.exe")

While 1
If Not ProcessExists("abc.exe") Then ExitLoop
WEnd
RunWait("def.exe")

so batfileinstallation.exe creates this process in Task manager

##### Share on other sites

Shouldn't it then be:

RunWait("D:\Batfileinstallation.exe")
While 1
If Not ProcessExists("D:\Batfileinstallation.exe") Then ExitLoop
WEnd
RunWait("\def.exe")

You should use ProcessExists to check for the longest running program. That should be the program after which you can safely start def.exe.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:

##### Share on other sites

Helo,Thanks.Iam not finding any luck.

Is there any other alternative?

Can i use processwait or Processwaitclose in between runwait?

##### Share on other sites

I think the problem isn't ProcessWaitClose, ProcessWait or ProcessExists but which process to wait for.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:

##### Share on other sites

Hello,

I tried both ways by mentioning process names but no luck.

any workaround solution?

##### Share on other sites

Experts,

I created an Auto IT package for running multiple packages .

RunWait("abc.exe" )

RunWait("def.exe" )

When i run this scrpit both exe files are getting installed same time but i dont want it as it creates issues.

Please suggest what should i need to so that abc.exe installs completely then def.exe Starts installs.

I dont want to use delay command in between because iam not sure about time taken for abc.exe installatiom.

Please suggest ,it would be of great help.

##### Share on other sites

Sekhar,

M23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

##### Share on other sites

Sorry

Iam sruggling with the script,i thought developer forum is different than this so that i get more inputs from different people.

If both are same then iam sorry for duplicate creation.

##### Share on other sites

Developer section is for non-AutoIt related questions. Even if that wasn't the case, posting in the developer section isn't going to provide you with a definite answer, as well all have access to the same sections.

##### Share on other sites

Thanks for the information.

Is there anyway i can run the exe files sequentially ?

##### Share on other sites

You will need to read up about Arrays and Run. This is where the wiki and help file come into their own.

Local $aArray[4] = [3, 'RUN_PATH', 'RUN_PATH', 'RUN_PATH'] ; Array with filepaths. For$i = 1 To $aArray[0]$aArray[$i] = Run($aArray[$i]) Next Local$iRunningProcesses = $aArray[0] ; Counter for number of running processes. While Not ($iRunningProcesses = 0)
For $i = 1 To$aArray[0]
If ProcessExists($aArray[0]) = 0 Then$iRunningProcesses -= 1 ; Decrease the counter.
EndIf
Next
Sleep(1000)
WEnd

## Create an account

Register a new account