Sign in with
Sign up | Sign in
Your question

"SC stop spooler" Access denied

Tags:
  • Hostname
  • Systems
  • Windows 7
Last response: in Windows 7
Share
June 29, 2011 7:00:01 PM

Hello Tom's, long time lurker first time poster.

Systems Admin for my company, writing a batch file to restart the spooler service. "SC \\hostname stop spooler" works fine but when I run SC Stop spooler on the system itself it gives me the error:

C:\Users\mydomainname.mydomain\Desktop>sc stop spooler
[SC] OpenService FAILED 5:

Access is denied.


I'm logged in as an admin, like I said it works fine remotely just not when on the local system. and I need to do this on a lot of systems so changing the hostname in the .bat each time is not an option.

Any suggestions would be appreciated!!

(all win 7 pro, SP1, 2008 AD)

More about : stop spooler access denied

June 29, 2011 7:07:16 PM

Just a little more info



SERVICE_NAME: spooler
TYPE : 110 WIN32_OWN_PROCESS (interactive)
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
m
0
l
June 29, 2011 7:14:14 PM

When run sc \\Myhostname stop spooler from a remote machine it works fine!



SERVICE_NAME: spooler
TYPE : 110 WIN32_OWN_PROCESS (interactive)
STATE : 3 STOP_PENDING
(NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0

What is going on?!
m
0
l
June 29, 2011 8:06:16 PM

Sorry I was being an idiot got the answer from technet

"You need to make sure you're running the command prompt as Administrator. Type cmd in the start menu, then right-click it and hit "Run as Administrator" -- otherwise it uses your standard user token, for security purposes."

All day I was writing batch files for remote machines and I forgot about this.
m
0
l
July 30, 2012 6:34:08 AM

Sbrigham said:
Sorry I was being an idiot got the answer from technet

"You need to make sure you're running the command prompt as Administrator. Type cmd in the start menu, then right-click it and hit "Run as Administrator" -- otherwise it uses your standard user token, for security purposes."

All day I was writing batch files for remote machines and I forgot about this.



Thanks Sbrigham, your information helped us at ontime.
m
0
l
!