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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Python script through ...
Power Automate
Unanswered

Python script through BAT file - Error 13

(0) ShareShare
ReportReport
Posted on by 54

Dear Community,

 

When PAD runs my BAT, I am receiving the following error.

Somehow it detects that the PAD is running the BAT file and therefore error occurs. 

 

When I run the file it works perfectly - In the same windows user session. 

 

Error: https://i.imgur.com/jJuNTOP.png 

Pad: https://i.imgur.com/7acW2Iu.png 

 

This is my script:

import MySQLdb as dbapi
import json
import datetime

QUERY1="SET SESSION MAX_EXECUTION_TIME = 0;"
QUERY="SELECT date_format(created_at, '%d %m %Y') as created, user_id, parent_id, status, metadata FROM x.accommodation_bookings WHERE parent_id is not null AND status in ('3', '4', '5')"
db=dbapi.connect(x",user="x",passwd="x")

cur=db.cursor()
cur.execute(QUERY1)
cur.execute(QUERY)
result=cur.fetchall()


with open("revenue.json","w") as f:
	for e in result:
		f.write(json.dumps(e) + "\n")

 

I have the same question (0)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 245

#2
David_MA Profile Picture

David_MA 216 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 212

Last 30 days Overall leaderboard