queryex
|
Queries the extended status for a service, or enumerates the status for types of services.
|
start
|
Starts a service.
Usage:
scstart [service name]...
|
pause
|
Sends a PAUSE control request to a service.
Usage:
scpause [service name]
|
interrogate
|
Sends an INTERROGATE control request to a service.
Usage:
scinterrogate [service name]
|
continue
|
Sends a CONTINUE control request to a service.
Usage:
sccontinue [service name]
|
stop
|
Sends a STOP request to a service.
Usage:
scstop [service name]
= Optional reason code number for service stop formed with the following elements in the format:
Flag:Major reason:Minor reason
[E.g., 1:2:8 means Hardware: Disk (Unplanned)]
Flag
------------------
1 - Unplanned
2 - Custom
4 - Planned
Major reason
------------------
1 - Other
2 - Hardware
3 - Operating System
4 - Software
5 - Application
64-255 - Custom
Minor reason
------------------
1 - Other
2 - Maintenance
3 - Installation
4 - Upgrade
5 - Reconfiguration
6 - Hung
7 - Unstable
8 - Disk
9 - Network Card
10 - Environment
11 - Hardware Driver
12 - Other Driver
13 - Service Pack
14 - Software Update
15 - Security Fix
16 - Security
17 - Network Connectivity
18 - WMI
19 - Service Pack Uninstall
20 - Software Update Uninstall
22 - Security Fix Uninstall
23 - MMC
256-65535 - Custom= Optional comment for the reason above (127 character maximum)
|
config
|
Changes the configuration of a service (persistent).
Usage:
scconfig [service name]...
Options:
type=
|
< own|share|interact|kernel|filesys|rec|adapt|userown|usershare>
|
start=
|
< boot|system|auto|demand|disabled|delayed-auto>
|
error=
|
< normal|severe|critical|ignore>
|
binPath=
|
< binarypathname to="" the="" .exe="" file="" >
|
group=
|
< LoadOrderGroup >
|
tag=
|
< yes|no>
|
depend=
|
< dependencies(separated by="" (forward="" slash))="">
|
obj=
|
< accountname|objectname>
|
DisplayName=
|
< display name >
|
password=
|
< password >
|
|
description
|
Changes the description of a service.
Usage:
scdescription [service name] [description]
|
failure
|
Changes the actions taken by a service upon failure.
Usage:
scfailure [service name]...
Options:
reset=
|
(Must be used in conjunction with actions= )
|
reboot=
|
< Message broadcast before rebooting on failure >
|
command=
|
< Command line to be run on failure >
|
actions=
|
< Failure actions and their delay time (in milliseconds), separated by / (forward slash) -- e.g., run/5000/reboot/800
Valid actions are
(Must be used in conjunction with the reset= option)
|
|
failureflag
|
Changes the failure actions flag setting of a service. If this setting is 0 (default), the SCM (Service Control Manager) enables configured failure actions on the service only if the service process terminates with the service in a state other than SERVICE_STOPPED. If this setting is 1, the SCM enables configured failure actions on the service if the service enters the SERVICE_STOPPED state with a Win32 exit code other than 0 in addition to the service process termination as above. This setting is ignored if the service does not have any failure actions configured.
Usage:
scfailureflag [service name] [flag]
|
sidtype
|
Changes the SID (service security identifier) type setting of a service.
If this setting is "unrestricted," the SCM will add this service's SID to the service process token when the service process starts the next time due to the first service in the process being started. This setting is valid only for Win32 user mode services.
If this setting is "restricted," the SCM will add this service's SID to the service process token when the service process starts the next time due to the first service in the process being started. Also, this service's SID is added to the restricting SID list in the process token. The process token will be a restricted token. See MSDN for details on a restricted token. This setting is valid only for Win32 user mode services. Also, for a share process service, all services cohosted in the process must have this SID type set for this to take effect.
If this setting is "none," the SCM will not add the service's SID to the service process token.
Usage:
scsidtype [service name] [type]
Options:
|
privs
|
Changes the required privileges setting of a service. The privilege settings take effect when the service process starts due to the first service in the process being started. At that time, the SCM (Service Control Manager) computes the union of all privileges required by all services that will be hosted in the same process and then creates the process with those privileges. An absence of this setting is taken to imply that the service requires all the privileges that the security subsystem allows for the process running in the service's configured account.
Usage:
scprivs [service name] [privileges]
Options:
privileges
|
[E.g., SeBackupPrivilege/SeRestorePrivilege]
|
|
managedaccount
|
Changes whether the account in which the service runs uses a managed password.
If this setting is "true", the SCM will request the account password from NetLogon when starting the service.
If this setting is "false", the SCM will use the configured account password.
Usage:
scmanagedaccount [service name] [type]
Options:
|
qc
|
Queries the configuration information for a service.
Usage:
scqc [service name]
|
qdescription
|
Queries the description for a service.
Usage:
scqdescription [service name]
|
qfailure
|
Queries the actions taken by a service upon failure.
Usage:
scqfailure [service name]
|
qfailureflag
|
Retrieves the failure actions flag setting of a service. If this setting is 0 (default), the SCM (Service Control Manager) enables configured failure actions on the service only if the service process terminates with the service in a state other than SERVICE_STOPPED. If this setting is 1, the SCM enables configured failure actions on the service if the service enters the SERVICE_STOPPED state with a Win32 exit code other than 0 in addition to the service process termination as above. This setting is ignored if the service does not have any failure actions configured.
Usage:
scqfailureflag [service name]
|
qsidtype
|
Queries the SID (service security identifier) type setting of a service.
If this setting is "unrestricted," the SCM (Service Control Manager) will add this service's SID to the service process token when the service process starts the next time due to the first service in the process being started. This setting is valid only for Win32 user mode services.
If this setting is "restricted," the SCM will add this service's SID to the service process token when the service process starts the next time due to the first service in the process being started. Also, this service's SID is added to the restricting SID list in the process token. The process token will be a restricted token. See MSDN for details on a restricted token. This setting is valid only for Win32 user mode services. Also, for a share process service, all services cohosted in the process must have this SID type set for this to take effect.
If this setting is "none," the SCM will not add the service's SID to the service process token.
Usage:
scqsidtype [service name]
|
qprivs
|
Queries the required privileges setting for a service. The privilege settings take effect when the service process starts due to the first service in the process being started. At that time, the SCM computes the union of all privileges required by all services that will be hosted in the same process and then creates the process with those privileges. An absence of this setting is taken to imply that the service requires all the privileges that the security subsystem allows for a process running in the service's configured account.
Usage:
scqprivs [service name]
|
qtriggerinfo
|
Queries the trigger parameters of a service.
Usage:
scqtriggerinfo [service name]
|
qpreferrednode
|
Queries the preferred NUMA node for a Win32 service. This setting is valid only for its own process services. If the service has no preferred node setting, then the query will fail.
Usage:
scqpreferrednode [service name]
|
qmanagedaccount
|
Queries whether a service uses an account with a password managed by LSA.
Usage:
scqmanagedaccount [service name]
|
qprotection
|
Queries whether the service is marked to start in a protected process. Note that this setting cannot be changed.
Usage:
scqprotection [service name]
|
quserservice
|
Queries for a user service instance for the current user in the same session created from the user service template specified.
Usage:
sc quserservice
|
delete
|
Deletes a service entry from the Registry. If the service is running, or another process has an open handle to the service, the service is marked for deletion.
Usage:
scdelete [service name]
|
create
|
Creates a service entry in the Registry and Service Database.
Usage:
sccreate [service name] [binPath= ]...
Options:
type=
|
< own|share|interact|kernel|filesys|rec|userown|usershare>
(default = own)
|
start=
|
< boot|system|auto|demand|disabled|delayed-auto>
(default = demand)
|
error=
|
< normal|severe|critical|ignore>
(default = normal)
|
binPath=
|
< binarypathname to="" the="" .exe="" file="" >
|
group=
|
< LoadOrderGroup >
|
tag=
|
< yes|no>
|
depend=
|
< dependencies(separated by="" (forward="" slash))="" >< /dependencies(separated >
|
obj=
|
< accountname|objectname >
(default = LocalSystem)
|
DisplayName=
|
< display name >
|
password=
|
< password >
|
|
control
|
Sends a control to a service.
Usage:
sccontrol [service name]
= user-defined control code
=
See also sc stop, sc pause, etc.
|
sdshow
|
Displays a service's security descriptor.
Usage:
scsdshow
|
sdset
|
Sets a service's security descriptor.
Usge:
scsdset
|
showsid
|
Displays the service SID string corresponding to an arbitrary name. The name can be that of an existing or non-existent service.
Usage:
sc showsid [name]
|
triggerinfo
|
Configures the trigger parameters of a service.
Usage:
sctriggerinfo [service name]...
Options:
start/device/UUID/HwId1/...
|
< Start the service on arrival of the specified device interface class UUID string with one or more hardware ID strings or compatible ID strings >
|
start/custom/UUID/data0/..
|
< Start the service on arrival of an event from the specified custom ETW provider UUID string with one or more binary data items in hexadecimal string format such as ABCDABCD to set 4-byte data >
|
stop/custom/UUID/data0/...
|
< Stop the service on arrival of an event from the specified custom ETW provider UUID string with one or more binary data items in hexadecimal string format such as ABCDABCD to set 4-byte data >
|
start/strcustom/UUID/data0/..
|
< Start the service on arrival of an event from the specified custom ETW provider UUID string with one or more optional string data items >
|
stop/strcustom/UUID/data0/..
|
< Stop the service on arrival of an event from the specified custom ETW provider UUID string with one or more optional string data items >
|
start/lvlcustom/UUID/data0/..
|
< Start the service on arrival of an event from the specified custom ETW provider UUID string with a level higher or equal to the data items in hexadecimal number format such as 0x01 >
|
stop/lvlcustom/UUID/data0/..
|
< Stop the service on arrival of an event from the specified custom ETW provider UUID string with a level higher or equal to the data items in hexadecimal number format such as 0x01 >
|
start/kwanycustom/UUID/data0/..
|
< Start the service on arrival of an event from the specified custom ETW provider UUID string with a keyword that matches any of the bits in the data items in hexadecimal number format such as 0x0A03 >
|
stop/kwanycustom/UUID/data0/..
|
< Stop the service on arrival of an event from the specified custom ETW provider UUID string with a keyword that matches any of the bits in the data items in hexadecimal number format such as 0x0A03 >
|
start/kwallcustom/UUID/data0/..
|
< Start the service on arrival of an event from the specified custom ETW provider UUID string with a keyword that matches all of the bits in the data items in hexadecimal number format such as 0x0A03 >
|
stop/kwallcustom/UUID/data0/..
|
< Stop the service on arrival of an event from the specified custom ETW provider UUID string with a keyword that matches all of the bits in the data items in hexadecimal number format such as 0x0A03 >
|
start/networkon
|
< Start the service on first IP address >
|
stop/networkoff
|
< Stop the service on zero IP addresses >
|
start/domainjoin
|
< Start the service on domain join >
|
stop/domainleave
|
< Stop the service on domain leave >
|
start/portopen/parameter
|
< start the="" service="" on="" opening="" of="" a="" network="" port.="" parameter="" is="" semi-colon="" delimited="" form="" portnumber;protocolname;imagepath;="" servicename="">
|
stop/portclose/parameter
|
< stop the="" service="" on="" closing="" of="" a="" network="" port.="" parameter="" is="" semi-colon="" delimited="" form="" portnumber;protocolname;imagepath;="" servicename="">
|
start/machinepolicy
|
< Start the service when machine group policy changes or is present at boot >
|
start/userpolicy
|
< Start the service when user group policy changes or is present at boot >
|
start/rpcinterface/UUID
|
< Start the service when a request arrives at the RPC Endpoint Mapper for the given interface >
|
start/namedpipe/pipename
|
< start the="" service="" when="" a="" request="" arrives="" for="" specified="" named="" pipe.="" do="" not="" include="" "\\.\pipe\"="" portion="" of="" pipe's="" name="" >
|
delete
|
< Delete the existing trigger parameters >
|
|
preferrednode
|
Changes the preferred NUMA node for a Win32 service. This setting is valid only for its own process services. To delete an existing setting, set the node number as -1. If an invalid preferred node number is supplied, then the change request will fail.
Usage:
scpreferrednode [service name] [node number]
|
GetDisplayName
|
Gets the DisplayName for a service.
Usage:
scGetDisplayName
|
GetKeyName
|
Gets the key name associated with a particular service, using the display name as input.
Usage:
scGetKeyName
|
EnumDepend
|
Enumerates Service Dependencies.
Usage:
scEnumDepend
|