I am writing a batch script to disable Windows server 2012 services.  The server WSSERVICE, sc config wsservice start= disabled, command is generating an error, "Access is Denied"  

How to fix this?     Thanks.
Who is Participating?
Frank McCourryConnect With a Mentor V.P. Holland Computers, Inc.Commented:
The Windows Store Service is one of those services that cannot be changed from the command line or the GUI.  you can use the registry however,


Change the "Start" Key to one of these Values:

    0 = Boot
    1 = System
    2 = Automatic
    3 = Manual
    4 = Disabled

You will have to restart the system for this to take effect.

If you need to automate this, you can use Group Policy.  Read this:
Frank McCourryV.P. Holland Computers, Inc.Commented:
Start your command prompt with elevated permissions.  

Some services will not allow changes "On the Fly"
zman2013Author Commented:
Thanks Frank.
Can this be automated with in the batch line?
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

zman2013Author Commented:
still getting access denied when run as administrator.  Thanks.
zman2013Author Commented:
Thanks Frank for the directions.  The following reg add command worked.

reg add “hklm\system\currentcontrolset\services\wsservice” /v start /t reg_dword /d /4 /f
Frank McCourryV.P. Holland Computers, Inc.Commented:
Glad I could help
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.