I have recently updated one of my machines to Vista. I have a batch file which I need to run that uses the SC command but whenever I run it I get an Access Denied message.
The user I am logged in as is part of the Administrators group and has the necessary rights assigned to the services registry keys and if I open the services MMC snap-in and manual stop/start the service I have no problems. The access denied message only occurs when trying to stop/start a service from the command line using SC.
I have a feeling it has something to do with the Vista security thing that keeps prompting me to verify I'm an Administrator even when logged in as a user of the Administrators group and it not working in with command line functions or something. Strangely If I log in as the administrator and run the sc command then it works.
***edit: SOLVED***
It appears I was correct in thinking that the 'Administrator Approval Mode' was interfering with the ability to control services from the command line. For anyone else that is having the problem or that just wants to disable the constant prompting of Windows Vista confirming your status as an administrator you can turn it off by doing the following:
--> Open Control Panel
--> Open Administrative Tools
--> Open the Local Security Policy
--> Expand the Local Policies key
--> Select Security Options
--> Scroll to the bottom and find and disable 'User Account Control: Run All Administrators in Admin Approval Mode'