cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
heliox
New Member

How do I get my Desktop Automation to wait for a .bat or python script that takes ~ 10s to return before continuing?

I have a .bat script that is transcoding video using ffmpeg. This takes around 10 seconds. When I call one of the DOS, Powershell, Python script controls they all return instantly. What am I doing wrong? Building in specific Waits into the flow isn't trustworthy. Thanks.
2 REPLIES 2
tc_procare
Frequent Visitor

I would try "Get Window" (for the script window) and then "Wait for Window Content" on the new script window, if you are able to implement a text out at the end of your script to show something unique like 'Exit Code 0' to act as a visual handshake for the flow to see.

VJR
Super User
Super User

Hi @heliox 

Multiple ways to achieve it. One of them is as below.

You can use Wait but in a different way.

 

Can you add an output to the .bat or python script such that it writes something to a text file after its work is done? Eg: "Process complete"

If so, then then after calling the script from PAD, you can add a loop such that it waits for every 5 or 10 secs to check if there is some text written in the text file. If not found then continue the loop. If found then the job is done. Need to add a counter for the "number of retry attempts" that the loop will continue else there are chances that it may go in an infinite loop.

 

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,581)