Notifications
Announcements
Hi, I'm trying to use power automate to run cmd. This cmd is intended to run a .py . After running it, a letter should be returned(eg: abcd). Is there a way for power automate to read this return and set as a variale? Thanks
Have you tried using the Read from CMD session action? It generates a variable called %CmdOutput% that contains whatever you read from the session.
-------------------------------------------------------------------------If I have answered your question, please mark it as the preferred solution.If you like my response, please give it a Thumbs Up.
If you are interested in Power Automate, you might want to follow me on LinkedIn at https://www.linkedin.com/in/agnius-bartninkas/
Yes, i've tried before, and here is the text i got. It do not return the output from the .py file. But actually, i've added print() at the end of the .py.
Microsoft Windows [Version 10.0.22621.1848](c) Microsoft Corporation. All rights reserved.
C:\Users\xxxxxxx\xxxx>python 1.py
I guess your Python script does not actually return anything to the CMD session.
Why don't you use the Run Python script action instead to run your Python script? Do you need it stored in a .py file?
Sorry for that. I'm not famaliar with runing python script. becuase when i trying to use it. It seems the power automate desktop fail to apply the python package. Really appreciate it if some reading materials related to this topic can be recommended. Thanks a lot!
PAD can run Python 2 scripts, so you would need to adapt your script accordingly if you created it with Python 3.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution.
If you like my response, please give it a Thumbs Up.
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 523 Super User 2025 Season 2
Tomac 406 Moderator
abm abm 245 Most Valuable Professional