I am attempting to create a scheduled task to run a batch file from the startup script. For some reason after the logon script runs and the scheduled task is created, the scheduled task will "run" but it does does not initiate the batch file.
The only solution I have found is to add 'run with the highest privileges' to the scheduled task.
I have over 200 users, so going PC to PC is out of the question, so my issue/question is when I add /RL highest to the logon script, it will neither change or create the scheduled task, instead I get an error "ERROR: Access is denied." however without /RL Highest, the script will complete successfully.
See below for both scripts
Without "highest privileges" -WORKS
schtasks /Create /tn "TestTask" /f /sc WEEKLY /d tue /st 10:30 /tr "c:\test.bat"
With "highest privileges" - DOESN'T WORK
schtasks /Create /tn "TestTask" /f /sc WEEKLY /d tue /st 10:30 /tr "c:\test.bat" /RU administrator /RP admin /RL HIGHEST