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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

cmd output reading

(0) ShareShare
ReportReport
Posted on by 7

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 

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    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/

  • RickyZh Profile Picture
    7 on at

    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

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    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?

    -------------------------------------------------------------------------
    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/

  • RickyZh Profile Picture
    7 on at

    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!

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    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.

    If you are interested in Power Automate, you might want to follow me on LinkedIn at https://www.linkedin.com/in/agnius-bartninkas/

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard