on a Windows 2008 R2 server I have two small .cmd-scripts to start/stop a certain service. They look like this

net start MyService

and

net stop MyService

I want to execute these script via scheduled task, and I thought it would be best to create a local user for this job. The user is not member of the Administrators group.
But the scripts fail with exit code 2. When I logon with this local user and try to execute these script in command line, I see a message like (maybe not exactly translated from german to english):

Error code 5: Access denied

It doesn't matter whether I start the command line as Administrator or not.
How can this local user gain rights to do the job?

link|improve this question
Check out the answer to this question - serverfault.com/questions/166641/… – Doug Luxem Feb 14 '11 at 14:32
Thank you - sounds pretty complicated and error prone. I will add the user to the Administrators group. – Mulmoth Feb 14 '11 at 14:56
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.