Additional Data: Error Value: 2147942401
Goal: Set up a Task to run nightly that either reads a Python script and runs it, or runs the batch file that reads the script. The python script is a geodatabase maintenance script that runs a bunch of clean up and writes a log to location to a drive. I would like to have this run during off working hours due to obvious reasons of locking staff out of accessing data and synchronizing of databases.
The python file has all pertinent paths coded in the format: r"\\Server\drivename\path\to\item"
The Batch file is as follows: 'Run_BasicGDBMaintenance_Script.bat'
"\\<machine>.<domain>.local\C$\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" "\\<machine>.<domain>.localhost\Users\<username>\OneDrive - <City One Drive Name>\Desktop\NightlyScript\BasicGDBMaintenance.py"
The python script will run, the .bat file will run, it will run in cmd, and the task scheduler will run as 'Run only when user is logged on'.
I have followed as much as I could understand from https://stackoverflow.com/questions/48343993/batch-file-from-scheduled-task-returns-code-2147942401
As well as the fixes in https://stackoverflow.com/questions/13618945/why-windows-7-task-scheduler-task-fails-with-error-2147942667
Highest privileges is on
Added my user to 'Log on as a batch job' & 'Log on as a service' in the Local Security Policy settings
I have 'Full Control' over the C:
Tried changing the Delay Timer in Task Scheduler > Triggers
Have it configured for Windows 10
Action: Task Scheduler Actions Page
Program/Script: "\\<machine>.<domain>.local\Users\<username>\OneDrive - <City One Drive Name>\Desktop\NightlyScript\Run_BasicGDBMaintenance_Script.bat"
Start in: \\<machine>.<domain>.local\Users\<username>\OneDrive - <City One Drive Name>\Desktop\NightlyScript\