I have a batch script on a local machine that calls a Python script on a Windows network share and should write a file there. If I run the Python script without the batch file, it runs successfully. If I run the batch file, I get this error:
Traceback (most recent call last):
File "python_script.py", line 25 in <module>
IOError: [Errno 13] Permission denied: 'outfile.txt'
The Python script lives in the same directory as "outfile.txt".
Here is the code from the Python script:
outfile = open("outfile.txt", "w")
I have also tried an absolute path, but I get an error that the "file is not found":
outfile = open("\\server\folder\subfolder\outfile.txt", "w")
I don't think it's a permission issue, because if I just run the python script "by hand" logged in as the same user, it writes the outfile to the network share. What am I missing using the batch file?