Hello,
I am trying to get a flow to work that uses CMD session. My flow looks like this:
All is working as expected when I start my flow from the edit window. However, when I execute the exact same flow from the main (or overview) window (first window you see when PAD is started) it doesn't work, even after the computer has been restarted.
I tried the following:
More infos that might be helpful:
Thanks for that, I also experienced the same problem.
I have a Desktop Flow executing commands in a CMD session, in the Desktop Flow it runs without error, but triggering the Desktop Flow with a Cloud Flow it errors.
I notice the same that the CMD session was being executed from the Cloud Flow, using a Batch Script or PowerShell as suggested was the workaround.
Thanks for help.
Thanks for the update, I got around my issue by creating a batch file and executing the batch file using a powershell command in Power Automate.
Then i just converted what I was doing to Powershell.
Thanks again for replying.
Unfortunately not. A few month ago I updated to the latest version of PA avaible back then to see if that had any effect but no, problem still exists to this day. I guess I am lucky that my affected flow is not a crucial one and also not a long one, so I always run mine in Edit mode. 🌚
Hey, did you find a solution to this issue, I’m experiencing the same problem with launching cmd commands with my glue just hanging there.
If you can, report this issue to Microsoft. In edit mode, flows run awfully slow.
Yes, I did, I'm on version 2.6.00158.21069 now. Still doesn't work. At least I know that it wasn't something in my code and that it is working on other machines. I guess from now on I will run my flows only from edit window to be on the safe side.
Your code works fine for me in console and edit mode. Did you update PAD to the latest version?
Thank you for investing time and trying it on your machine, sharing the results with me. It seems that my company's laptop or IT infrastructure has something to do with it then. Maybe its a security thing.
Here's the code of the Flow I tested this issue with, just in case:
Folder.GetSpecialFolder SpecialFolder: Folder.SpecialFolder.Personal SpecialFolderPath=> SpecialFolderPath
Cmd.Open Directory: SpecialFolderPath Session=> CmdSession
Cmd.Write Session: CmdSession Command: $'''ipconfig''' SendEnter: True
Cmd.Read Session: CmdSession CmdOutput=> CmdOutput
Cmd.Close Session: CmdSession
File.WriteText File: $'''C:\\Users\\olafp\\Desktop\\CmdCheck.txt''' TextToWrite: CmdOutput AppendNewLine: True IfFileExists: File.IfFileExists.Overwrite Encoding: File.FileEncoding.Unicode
System.RunApplication ApplicationPath: $'''C:\\Users\\olafp\\Desktop\\CmdCheck.txt''' WindowStyle: System.ProcessWindowStyle.Normal ProcessId=> AppProcessId
I also tried different folders for CMD session, including the default one.
Strange, even with ipconfig it works fine for me. Could you paste your flow code here?
Did you try a different working folder, like your user folder?
Any reason you didn't yet update to Windows 10 version 2004?
Any security software which might prevent app execution?
There is no error message, the command just don't get executed properly.
I did some more testing and was able to narrow down the problem more. The specific CMD command ipconfig seems to play a role here.
Whenever I let PAD write the command ipconfig to CMD session, CmdOutput holds different outputs depending on which window the Flow has been started from.
When starting the flow from edit window, the result is as expected, CmdOutput holds the usual expected information about Windows IP configuration, ethernet adapters, IPs, subnet masks etc. etc.
When starting the flow from main window CmdOutput holds only this information:
Microsoft Windows [Version 10.0.18363.1440]
(c) 2019 Microsoft Corporation. Alle Rechte vorbehalten.
C:\Program Files (x86)\Power Automate Desktop>ipconfig
Nothing more.
I tested another CMD command: dir generates the same expected output no matter which PAD-window I start the flow from.
What am I missing? Any idea what causes this problem? Can I add something to my flow to prevent this from happening?
eetuRobo
4
Super User 2025 Season 1
KO-05050229-0
2
stampcoin
2