Microsoft Power Automate is a software by Microsoft for the automation of recurring tasks. It is part of the Microsoft Power Platform line of products together with products such as Power Apps and Power BI. More Details https://powerautomate.microsoft.com/en-us/
Desktop flows are the existing robotic process automation (RPA) capabilities in Power Automate and enable to automate of all repetitive desktop processes.
Scripting actions enable you to run blocks of code and implement custom behavior in your desktop flows. All scripting actions follow the basic structure of the respective programming or scripting language: PowerShell, Python, DOS Command, VBScript, and JavaScript.
Using the Dos command action executes a DOS command or console application in invisible mode and retrieves its output upon completion.
Reading this article, you can learn how to Execute the DOS Command using Run Dos command actions with the Desktop flow in Microsoft Power Automate.
The following important tools are required for developing Microsoft Power Automate,
- Windows 10/11 (Recommended)
- Power Automate Desktop - Download the Power Automate installer
Now we can discuss step-by-step App development.
Step 1. Open Microsoft Power Automate -> New Flow. Next, Give the Flow name as PADDos, Click the Create button,
After that, we are able to see the Desktop flow,
Step 2. For Testing the Run Dos command action in Scripting actions,
Add the Run Dos command action, and Set the DOS command or application parameter as “Dir” and Working folder parameter as <File Path> and the following variables produced automatically, For output CommandOutput variable and CommandErrorOutput variable for errors that may occur during the execution of the Command.
For Displaying the Run Dos command Output, Add the Display message action, Set the Message box title Parameter value as “DisplayDos”, and Message to display Parameter value as
- %CommandOutput%
- %CommandErrorOutput%
and Click the Save Button.
Now, Save the PADDos Desktop Flow,
Step 3. Now we can run your PADDos Desktop Flow in Microsoft Power Automate,
The output of the PADDos,
Summary
Now, you are successfully tested the Run Dos command action in Desktop flow – PADDos in Microsoft Power Automate.