How to grant "log on as batch job" in Windows 7 Home Premium
I just spent an hour trying to figure out this one so I thought I'd share the wisdom...
If you have been trying to schedule a task and run it as a regular user in Windows 7 you will probably have come across this...

This is due to a basic security measure implemented in all recent versions of Windows which requires users that run scheduled tasks to have a special security right. (A similar security measure is also used in the services system but when you change the user in the services manager it automatically grants the user the right and tells you its done so.)
Here's where the fun starts... If you have Windows 7 Professional, Ultimate or whatever you can simply go to the local security policy editor (under administrative tools) and assign the right; unfortunately if you are using the home versions you are stuck as the local security policy editor doesn't exist!
So what do you do?
Well you could compromise the security of your system and run the task as an administrator or something but personally I like all my applications to be contained in their own login as a form of damage limitation. Why give a scheduled task access to your whole system when it only needs to read 3 files?
The other option is to find a way to add the right... Being a determined chap I made that my goal, and heres how I managed it:
- Download and install the Windows Server 2003 Resource Kit Tools (yes I know its not the right version of Windows but we only need one executable and that at least seems to work)
- Open a Command Prompt as an administrator. You can do this by clicking the start button followed by "All Programs" then "Accessories". Then right clicking "Command Prompt" and selecting "Run as administrator". (You will need to authorise this if it asked for a password or confirmation.)
- Type the following command:
ntrights -u COMPUTER\User +r SeBatchLogonRight
Remember to replace COMPUTER\user with your computer name and the user account you wish to use.
Job done!
Hope this helps!
(Updated: 9:13, Fri 9th Jul 2010)
Posted by Daniel: 11:14, Mon 1st Mar 2010
RE: How to grant "log on as batch job" in Windows 7 Home Premium
Thanks a lot for sharing this trick.
I must add that it is SeBatchLogonRight, not SeBatchLoginRight
ntrights -u LAPTOP\Daniel +r SeBatchLoginRight
will fail with an error:
Granting SeBatchLoginRight to LAPTOP\Daniel ... failed
AddUserRightToAccount:
***Error*** AddUserRightToAccount -1073741728
ntrights -u LAPTOP\Daniel +r SeBatchLogonRight
will work:
Granting SeBatchLogonRight to LAPTOP\Daniel ... successful
What a mess this system is...
RE: How to grant "log on as batch job" in Windows 7 Home Premium
Thanks for that Dalvarez, you're right. I've corrected my typo.
Posted by Daniel: 9:12, Fri 9th Jul 2010
Login to leave a comment...
I want to create an account I've forgotten my password/activation code
By logging in you consent to allowing us to store a cookie on your machine which contains a unique encrypted reference to identify you to our servers.

RE: How to grant "log on as batch job" in Windows 7 Home Premium
This will probably also work in Vista Home but I havn't tested it...
Posted by Daniel: 11:20, Mon 1st Mar 2010