Skip to main content

Notifications

Community site session details

Community site session details

Session Id : +bKfG7FMguFWyMHsMT1/HF
Power Automate - Power Automate Desktop
Unanswered

PermissionError: [WinError 5] Access is denied

Like (0) ShareShare
ReportReport
Posted on 30 Apr 2024 19:47:04 by

Hello! I'm trying to use Power Automate to run a Python 3.9 script via PowerShell. I've defined a variable to store the path to Python on my computer and another for the path to the script I want to execute.

 

The script's purpose is to merge .xlsx files, create folders, and move these files to the corresponding folders. However, when running the script, I encounter a 'PermissionError: [WinError 5] Access denied 'C:\\Program Files\\WindowsApps\\Microsoft.PowerAutomateDesktop_11.2404.195.0_x64__8wekyb3d8bbwe\\2024'', specifically on the line of code that attempts to create the folders.

 

I've ensured that Power Automate is running as an administrator, that the folder allows access and modification for any user, and that my firewall isn't interfering with the system.

 

Is there any way to grant permissions to Power Automate to resolve this issue?

 

The workflow I've set up is as follows:

  1. Define the variable for the Python path.
  2. Define the variable for the script path.
  3. Execute the script via PowerShell.
  4. Display an error message if any occurs."

 

Mangel4_0-1714506401352.png

 

  • eetuRobo Profile Picture
    3,259 Super User 2025 Season 1 on 02 May 2024 at 11:14:17
    Re: PermissionError: [WinError 5] Access is denied

    Does the python script work if you run it without Power Automate Desktop? Or does it fail similarly when trying to create the folders?
    And just to make sure when you say that the user allows access and modifications for the folder you mean that the user also has Write permissions?

    eetuRobo_1-1714648388498.png


    What version of PAD do you have? Maybe you could try updating to the newest PAD version and try to just use the Run python script -action since it got support for Python v3 last month. 

    eetuRobo_0-1714645034604.png


    Maybe try some of these solutions: https://stackoverflow.com/questions/36360167/when-using-python-os-rmdir-get-permissionerror-winerror-5-access-is-denied

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Power Automate Desktop

#1
eetuRobo Profile Picture

eetuRobo 4 Super User 2025 Season 1

#2
KO-05050229-0 Profile Picture

KO-05050229-0 2

#2
stampcoin Profile Picture

stampcoin 2

Overall leaderboard
Loading started