GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing ss64.com — SC - Service Control command - Windows CMD SC.exeService Control - Create, Start, Stop, Query or Delete any Windows SERVICE. The command options for SC are case sensitive. Syntax
Indicate whether the last boot should be saved as the last-known-good boot configuration:
SC [\\server] boot {OK | bad}
Configure a service:
SC [\\server] config service_name [option1] [option2]...
CONTINUE a service:
SC [\\server] continue [service_name]
Send a control to a service:
SC [\\server] control [service_name] [{paramchange | netbindadd | netbindremove | netbindenable
| netbinddisable | UserDefinedControlB}]
Create a service (add it to the registry):
SC [\\server] create service_name [binPath= ] [option1] [option2]...
Delete a service (from the registry):
SC [\\server] delete [service_name]
Change the description of a service:
SC [\\server] description [service_name] [Description]
Enumerate service Dependencies:
SC [\\server] enumdepend [service_name] [BufferSize]
Change the actions taken by a service upon failure: (delay times in MS milliseconds)
SC [\\server] failure [service_name] [reset= ErrorFreePeriod] [reboot= BroadcastMessage]
[command= CommandLine] [actions= {"" | {[run/MS] | [restart/MS] | [reboot/MS]}[/...]]
ErrorFreePeriod Specifies the number of seconds with no failures after which the failure
count will reset to 0. This parameter requires the actions= parameter.
Change the failure actions flag of a service:
SC [\\server] failureflag [service_name] [Flag]
The default flag value is 0 (no action). If this is set to 1, and if the user has already
configured recovery actions for service failures, then the recovery actions will also be
triggered if the service stops because of an error.
Get the DisplayName of a service:
SC [\\server] getdisplayname [service_name] [BufferSize]
Get the ServiceKeyName of a service:
SC [\\server] getkeyname [service_name] [BufferSize]
Send an INTERROGATE control request to a service:
SC [\\server] interrogate [service_name]
Lock the services database:
Locking the Service Control Manager's database prevents any services from starting.
Use this command if you want to make sure that a service will not be started after it
has been stopped. This will enable you to perform an action (for example, deleting the service)
without interference. Unlock the database by typing u.
You can also stop the process from which you locked the database.
SC Lock
Query the LockStatus for the SCManager Database:
This will show if a service request is running.
SC Querylock
Change the service to mark the service account as being managed by LSA:
SC [\\server] managedserviceaccount [service_name] {true | false}
Set the preferred NUMA mode of a service you own: (to remove this, set Node No. to -1)
SC [\\server] preferrednode [service_name] [Node-Number]
Change the required privileges of a service:
(separate multiple privs with / e.g. SeBackupPrivilege/SeRestorePrivilege)
SC [\\server] privs [service_name] [privileges]
PAUSE a service:
SC [\\server] pause [service_name]
Query the configuration:
SC [\\server] qc [service_name] [BufferSize]
Query the configuration:
SC [\\server] qc [service_name] [BufferSize]
Query the description of a service:
SC [\\server] Qdescription [service_name] [BufferSize]
Query the actions taken by a service upon failure:
SC [\\server] Qfailure [service_name] [BufferSize]
Query whether the service uses an account with a password managed by LSA:
SC [\\server] Qmanagedaccount [service_name]
Query the preferred NUMA node of a service:
SC [\\server] Qpreferrednode [service_name]
Query the process protection level of a service:
SC [\\server] Qprotection [service_name]
Query the required privileges of a service:
SC [\\server] Qprivs [service_name] [BufferSize]
Query the service SID Type of a service: (RESTRICTED / UNRESTRICTED / NONE)
SC [\\server] Qsidtype [service_name]
Query the trigger parameters of a service:
SC [\\server] Qtriggerinfo [service_name] [BufferSize]
Query for a local instance of a User Service Template:
SC [\\server] Quserservice [Service_Template_Name]
Show status of a service or enumerate the status for types of service:
SC [\\server] query [service_name] [type= {driver | service | all}]
[type= {own | share | interact | kernel | filesys | rec | adapt}]
[state= {active | inactive | all}]
[bufsize= Buffersize] [ri= Resumeindex] [group= groupname] [/?]
The type= parameter can be used twice in some cases. The first appearance specifies
whether to query services, drivers, or both (all). The second appearance of the type= parameter
specifies a type from the create operation to further narrow a query's scope.
Show extended information, pid, flags:
SC [\\server] queryex [service_name] [type= {driver | service | userservice | all}]
[type= {own | share | interact | kernel | filesys | rec | adapt}]
[state= {active | inactive | all}] [bufsize= BufferSize]
[ri= ResumeIndex] [group= {"" | GroupName}] [/?]
Set a service’s security descriptor using SDDL:
SC [\\server] sdset service_name ServiceSecurityDescriptor
Display a service’s security descriptor using SDDL:
SC [\\server] sdshow service_name
Display the service SID string corresponding to an arbritary name:
(name can be an existing or non-existent service)
SC [\\server] showsid name
Change the service SID Type of a service:
SC [\\server] sidtype [service_name] {none | unrestricted | restricted}
START a service:
SC [\\server] start service_name [ServiceArguments]
STOP a service:
SC [\\server] stop service_name
Configure the trigger parameters of a service:
(list the options with SC triggerinfo)
SC [\\server] triggerinfo [service_name] [option1] [option2]...
Key
server : The machine where the service is running
service_name : The KeyName of the service, this is often but not always
the same as the DisplayName shown in Control Panel, Services.
You can get the KeyName by running:
SC GetKeyName DisplayName
BufferSize : Size of the enumeration/display buffer in bytes, Default = 1024.
When the display resulting from a command exceeds the size of the buffer,
a message similar to the following is displayed:
Enum: more data, need 2130 bytes start resume at index 75
The remaining output could be displayed by typing:
sc queryex bufsize= 2130 ri= 75
qryOpt:
type= driver|service|all
Query specific types of service.
state= active|inactive|all
The started state of the service to be enumerated.
bufsize= bytes
ri= resume_index_number (default=0)
group= groupname
Query services in a particular group.
Options for Create and Config:
binPath= BinaryPathName to the .exe file
depend= Dependencies (separated by / (forward slash))
DisplayName= display_name
error= { normal|severe|critical|ignore }
group= LoadOrderGroup
obj= { AccountName|ObjectName }
password= password
start= { boot|system|auto|demand|disabled|delayed-auto }
tag= { yes|no }
type= { own|share|interact|kernel|filesys|rec|userown|usershare }
Defaults when creating a service: type= own, start= demand, error= normal, obj= LocalSystem
NOTE: The option name includes the equal sign. A space is required between the equal sign and
the value. e.g. to disable a service: SC config "Name of Service" start= disabled
The qryOpt options above are case sensitive, they must be entered in lower case. If [service_name] is left blank, most SC commands will display help. Kernel device drivers are not displayed in the Windows Control Panel ➞ Services but can be displayed by SC. Query a Service state
Start a Service
PowerShell
ExamplesFind the service name given a display name:
Find a display name given a service name:
Query a service state:
Start a service:
Disable a service:
Delete a service:
List all drivers:
List all services:
Display extended information about all service groups:
Configure a service:
Disable Windows Update: SC config wuauserv start= disabled NET stop wuauserv SC config bits start= disabled NET stop bits SC config dosvc start= disabled NET stop dosvc Re-enable Windows Update: SC config wuauserv start= auto NET start wuauserv SC config bits start= disabled NET start bits SC config dosvc start= disabled NET start dosvc Enable remote registry access on computer64: SC \\computer64 config remoteregistry start= auto SC \\computer64 start remoteregistry “There is always room at the top” ~ Daniel Webster Related commandsNET service - Start/Stop services. Equivalent PowerShell: Copyright © 1999-2026 SS64.com
Some rights reserved |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |