I'm trying to schedule a Python script through Windows Task Scheduler by making a batch file.
Here's what I tried.
Normally putting python location in program/script and specifying the python file in arguments in task scheduler.
Trying through batch file
start C:\Python27\pythonw.exe C:\Users\...\time_convert.py pause
Call C:\Python27\pythonw.exe C:\...\time_convert.py pause
C:\Python27\pythonw.exe C:\Users\...\time_convert.py pause
Also when I run the batch file manually it works fine. But not through task scheduler.
I can see a CMD window pops but a new text file doesn't gets created as per the .py
script.
Here's the demo .py
script:
print("done")
f=open("ay.txt",'w')
f.write("hi")
f.close()