web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How do I get my Deskto...
Power Automate
Unanswered

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

(0) ShareShare
ReportReport
Posted on by
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.
I have the same question (0)
  • tc_procare Profile Picture
    20 on at

    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 Profile Picture
    7,635 on at

    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.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 468

#2
Haque Profile Picture

Haque 370

#3
Valantis Profile Picture

Valantis 354

Last 30 days Overall leaderboard