Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Local Admin - Error when running SC command from command prompt -- [SC] OpenService FAILED 5:  Access is denied.

Posted on 2011-09-12
3
Medium Priority
?
3,266 Views
Last Modified: 2012-05-12
I am trying to figure out how to stop then start a service from a command prompt on a Windows 2008 server.  I am not a domain administrator, but I am a local administrator on the server I am trying to do this on.  If I am remoted into the server, and I open a command prompt and type "sc stop <service_name>", I see the following:

C:\>sc stop <service_name>
[SC] OpenService FAILED 5:

Access is denied.

Open in new window


Am I able to use the sc command in this manner?  Is there another alternative for stopping then starting a service?
0
Comment
Question by:sah18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
Subhashish Laha earned 2000 total points
ID: 36524279
Did you try opening Command Prompt by right click and selecting "Run as Administrator"? If not then try it, it should resolve the problem.
0
 
LVL 9

Author Comment

by:sah18
ID: 36526263
subhashishlaha - perfect, that was exactly it.  quick followup on this -- I really want to run this in a batch file.  How do I do the equivalent you mentioned (running as Administrator) when running this in a batch?  I'll award points right now, as I understand this is beyond my initial question.  If you happen to know how, though, I'd greatly appreciate the help!
0
 
LVL 10

Expert Comment

by:Subhashish Laha
ID: 36529101
@Sah18

Good to know that you got the resolution and thank you for the points.

Please create new question for your query, will reply to that.
0

Featured Post

Ready for your healthcare security check-up?

In the past few years, healthcare organizations have become a prime target for advanced attacks. Does your organization have what it needs to defend itself? Schedule your healthcare security check-up today and download our free Healthcare Security Resource Kit today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Let’s face it: one of the reasons your organization chose a SaaS solution (whether Microsoft Dynamics 365, Netsuite or SAP) is that it is subscription-based. The upkeep is done. Or so you think.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question