I am needing to run a batch job as a different user. However, the job appears to be hanging before it even starts. I think this has something to do with the GlobalSettings.xml. I am just not sure how it should be setup.
Per our company policies, this job is not allowed to runas my user login, but instead a service account that has permissions to run batch jobs.
Under my login, the batch job does run successfully.
Running Batch Job as Different User
- Posts: 1
- Joined: 11 Aug 2020
- Posts: 1
- Joined: 13 Dec 2022
I may have had the same problem as you.
Windows Task Scheduler result was 0x2: File not found
My solution was to ensure the following:
Account used to run Scheduled Task must have modify access to FreeFileSync folders to be synced.
Use UNC folder paths for folders to be synched as network drive letter mappings would fail for the account used to run the scheduled task.
Ensure Task Scheduler scheduled task 'Program/script' has "C:\Program Files\FreeFileSync\FreeFileSync.exe"
Ensure Task Scheduler scheduled task 'Add arguments (optional)' has the following:
%PathToFreeFileSyncUserGlobalSettings.xml% %PathToFreeFileSyncBatchFile.ffs_batch%
Example, C:\Users\FFSUsername\AppData\Roaming\FreeFileSync\GlobalSettings.xml C:\Scripts\BatchRun.ffs_batch
Check C:\Users\FFSUsername\AppData\Roaming\FreeFileSync\Logs for errors.
Windows Task Scheduler result was 0x2: File not found
My solution was to ensure the following:
Account used to run Scheduled Task must have modify access to FreeFileSync folders to be synced.
Use UNC folder paths for folders to be synched as network drive letter mappings would fail for the account used to run the scheduled task.
Ensure Task Scheduler scheduled task 'Program/script' has "C:\Program Files\FreeFileSync\FreeFileSync.exe"
Ensure Task Scheduler scheduled task 'Add arguments (optional)' has the following:
%PathToFreeFileSyncUserGlobalSettings.xml% %PathToFreeFileSyncBatchFile.ffs_batch%
Example, C:\Users\FFSUsername\AppData\Roaming\FreeFileSync\GlobalSettings.xml C:\Scripts\BatchRun.ffs_batch
Check C:\Users\FFSUsername\AppData\Roaming\FreeFileSync\Logs for errors.
- Posts: 2288
- Joined: 22 Aug 2012