Script will pick the xml file from XML folder and parse it, it is running great when I run .py file directly. But, when I call the .py using .bat file I am getting below errors.
XML.bat
@ECHO OFF
REM A batch script to execute a Python script
SET PATH=%PATH%;C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.6
py GET_XML.py
PAUSE
Python snippet for getting file name under xml folder
import os
pathx = (os.path.dirname(__file__)+str('\\xml\\'))
list1 = os.listdir(pathx)
#GET Folder
#print(pathx)
paths = (''.join(map(str,list1)))
#GET Files inside Folder
#print(paths)
#Insert in xml parse
tree = ET.parse(paths)
root = tree.getroot()
Error
Directory Structure
Python(folder)
+GET_XML.py
+XML.bat
+XML (folder)
+1231.xml