After creating a scheduled task in the Windows Task Scheduler, you get this message:
Task Scheduler
This task requires that the user account specified has Log on as batch job rights.
This is because the user account requires the ability to log on to run batch jobs, so the scheduled task can run when the user isn’t logged in (As you specified that the scheduled task should run even if the user isn’t logged in).
To do this, click Start and type secpol.msc. Navigate to Security Settings -> Local Policies -> User Rights Assignment and edit Log on as batch job to include the user that you specified in the scheduled task.
You can also do this as a group policy, the GPO setting can be found here:
Computer Settings -> Policies -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment
and the GPO you’re looking for is called Log on as batch.