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
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?