19 _T(
"\tSC is a command line program used for communicating with\n")
20 _T(
"\tthe Service Control Manager and its services.\n")
22 _T(
"\tsc <server> [command] [service name] <option1> <option2>...\n")
24 _T(
"\tThe optional parameter <server> has the form \"\\ServerName\"\n")
25 _T(
"\tFurther help on commands can be obtained by typing: \"sc [command]\"\n")
26 _T(
"\tService Commands:\n")
27 _T(
"\t query : Queries the status for a service, or\n")
28 _T(
"\t enumerates the status for types of services.\n")
29 _T(
"\t queryex : Queries the extended status for a service, or\n")
30 _T(
"\t enumerates the status for types of services.\n")
31 _T(
"\t start : Starts a service.\n")
32 _T(
"\t pause : Sends a PAUSE control request to a service.\n")
33 _T(
"\t interrogate : Sends a INTERROGATE control request to a service.\n")
34 _T(
"\t continue : Sends a CONTINUE control request to a service.\n")
35 _T(
"\t stop : Sends a STOP request to a service.\n")
36 _T(
"\t config : Changes the configuration of a service (persistent).\n")
37 _T(
"\t description : Changes the description of a service.\n")
38 _T(
"\t failure : Changes the actions taken by a service upon failure.\n")
39 _T(
"\t qc : Queries the configuration information for a service.\n")
40 _T(
"\t qdescription : Queries the description for a service.\n")
41 _T(
"\t qfailure : Queries the actions taken by a service upon failure.\n")
42 _T(
"\t delete : Deletes a service (from the registry).\n")
43 _T(
"\t create : Creates a service (adds it to the registry).\n")
44 _T(
"\t control : Sends a control to a service.\n")
45 _T(
"\t sdshow : Displays a service's security descriptor.\n")
46 _T(
"\t sdset : Sets a service's security descriptor.\n")
47 _T(
"\t GetDisplayName : Gets the DisplayName for a service.\n")
48 _T(
"\t GetKeyName : Gets the ServiceKeyName for a service.\n")
49 _T(
"\t EnumDepend : Enumerates Service Dependencies.\n"));
57 _tprintf(
_T(
"\nWould you like to see help for the QUERY and QUERYEX commands? [ y | n ]: "));
63 _T(
" If the query command is followed by a service name, the status\n")
64 _T(
" for that service is returned. Further options do not apply in\n")
65 _T(
" this case. If the query command is followed by nothing or one of\n")
66 _T(
" the options listed below, the services are enumerated.\n")
67 _T(
" type= Type of services to enumerate (driver, service, interact, all)\n")
68 _T(
" (default = service)\n")
69 _T(
" state= State of services to enumerate (active, all, inactive)\n")
70 _T(
" (default = active)\n")
71 _T(
" bufsize= The size (in bytes) of the enumeration buffer\n")
72 _T(
" (default = 4096)\n")
73 _T(
" ri= The resume index number at which to begin the enumeration\n")
74 _T(
" (default = 0)\n")
75 _T(
" group= Service group to enumerate\n")
76 _T(
" (default = all groups)\n")
77 _T(
"SYNTAX EXAMPLES\n")
78 _T(
"sc query - Enumerates status for active services & drivers\n")
79 _T(
"sc query messenger - Displays status for the messenger service\n")
80 _T(
"sc queryex messenger - Displays extended status for the messenger service\n")
81 _T(
"sc query type= driver - Enumerates only active drivers\n")
82 _T(
"sc query type= service - Enumerates only Win32 services\n")
83 _T(
"sc query state= all - Enumerates all services & drivers\n")
84 _T(
"sc query bufsize= 50 - Enumerates with a 50 byte buffer.\n")
85 _T(
"sc query ri= 14 - Enumerates with resume index = 14\n")
86 _T(
"sc queryex group= \"\" - Enumerates active services not in a group\n")
87 _T(
"sc query type= service type= interact - Enumerates all interactive services\n")
88 _T(
"sc query type= driver group= NDIS - Enumerates all NDIS drivers\n"));
96 _T(
" Starts a service running.\n")
98 _T(
" sc <server> start [service name] <arg1> <arg2> ...\n"));
105 _T(
" Sends a PAUSE control request to a service.\n")
107 _T(
" sc <server> pause [service name]\n"));
113 _T(
" Sends an INTERROGATE control request to a service.\n")
115 _T(
" sc <server> interrogate [service name]\n"));
122 _T(
" Sends a STOP control request to a service.\n")
124 _T(
" sc <server> stop [service name]\n"));
130 _T(
" Sends a CONTINUE control request to a service.\n")
132 _T(
" sc <server> continue [service name]\n"));
138 _T(
" Deletes a service entry from the registry.\n")
139 _T(
" If the service is running, or another process has an\n")
140 _T(
" open handle to the service, the service is simply marked\n")
141 _T(
" for deletion.\n")
143 _T(
" sc <server> delete [service name]\n"));
148 _tprintf(
_T(
"Creates a service entry in the registry and Service Database.\n")
150 _T(
"sc create [service name] [binPath= ] <option1> <option2>...\n")
151 _T(
"CREATE OPTIONS:\n")
152 _T(
"NOTE: The option name includes the equal sign.\n")
153 _T(
" type= <own|share|interact|kernel|filesys|rec>\n")
154 _T(
" (default = own)\n")
155 _T(
" start= <boot|system|auto|demand|disabled>\n")
156 _T(
" (default = demand)\n")
157 _T(
" error= <normal|severe|critical|ignore>\n")
158 _T(
" (default = normal)\n")
159 _T(
" binPath= <BinaryPathName>\n")
160 _T(
" group= <LoadOrderGroup>\n")
161 _T(
" tag= <yes|no>\n")
162 _T(
" depend= <Dependencies(separated by / (forward slash))>\n")
163 _T(
" obj= <AccountName|ObjectName>\n")
164 _T(
" (default = LocalSystem)\n")
165 _T(
" DisplayName= <display name>\n")
166 _T(
" password= <password>\n"));
172 _T(
" Sends a CONTROL code to a service.\n")
174 _T(
" sc <server> control [service name] <value>\n")
175 _T(
" <value> = user-defined control code\n")
176 _T(
" <value> = <paramchange|\n")
177 _T(
" netbindadd|netbindremove|\n")
178 _T(
" netbindenable|netbinddisable>\n"));
184 _T(
" Displays a service's security descriptor in SDDL format.\n")
186 _T(
" sc <server> sdshow <service name>\n"));
192 _T(
" Sets a service's security descriptor.\n")
194 _T(
" sc <server> sdset <service name> <SD in SDDL format>\n"));
200 _T(
" Queries the configuration information for a service.\n")
202 _T(
" sc <server> qc [service name] <bufferSize>\n"));
208 _T(
" Retrieves the description string of a service.\n")
210 _T(
" sc <server> qdescription [service name] <bufferSize>\n"));
216 _T(
" Retrieves the actions performed on service failure.\n")
218 _T(
" sc <server> qfailure [service name] <bufferSize>\n"));
224 _T(
" Sets the description string of a service.\n")
226 _T(
" sc <server> description [service name] [description]\n"));
232 _T(
" Modifies a service entry in the registry and Service Database.\n")
234 _T(
" sc <server> config [service name] <option1> <option2>...\n")
235 _T(
"CONFIG OPTIONS:\n")
236 _T(
" NOTE: The option name includes the equal sign.\n")
237 _T(
" type= <own|share|interact|kernel|filesys|rec>\n")
238 _T(
" start= <boot|system|auto|demand|disabled>\n")
239 _T(
" error= <normal|severe|critical|ignore>\n")
240 _T(
" binPath= <BinaryPathName>\n")
241 _T(
" group= <LoadOrderGroup>\n")
242 _T(
" tag= <yes|no>\n")
243 _T(
" depend= <Dependencies(separated by / (forward slash))>\n")
244 _T(
" obj= <AccountName|ObjectName>\n")
245 _T(
" DisplayName= <display name>\n")
246 _T(
" password= <password>\n"));
252 _T(
" Changes the actions upon failure.\n")
254 _T(
" sc <server> failure [service name] <option1> <option2>...\n")
257 _T(
" reset= <Length of period of no failures (in seconds)\n")
258 _T(
" after which to reset the failure count to 0 (may be INFINITE)>\n")
259 _T(
" (Must be used in conjunction with actions= )\n")
260 _T(
" reboot= <Message broadcast before rebooting on failure>\n")
261 _T(
" command= <Command line to be run on failure>\n")
262 _T(
" actions= <Failure actions and their delay time (in milliseconds),\n")
263 _T(
" separated by / (forward slash) -- e.g., run/5000/reboot/800\n")
264 _T(
" Valid actions are <run|restart|reboot> >\n")
265 _T(
" (Must be used in conjunction with the reset= option)\n"));
271 _T(
" Gets the display name associated with a particular service.\n")
273 _T(
" sc <server> GetDisplayName <service key name> <bufsize>\n"));
279 _T(
" Gets the key name associated with a particular service, using the\n")
280 _T(
" display name as input.\n")
282 _T(
" sc <server> GetKeyName <service display name> <bufsize>\n"));
288 _T(
" Enumerates te Services that are dependent on this one.\n")
290 _T(
" sc <server> EnumDepend <service display name> <bufsize>\n"));
VOID QueryConfigUsage(VOID)
VOID QueryFailureUsage(VOID)
VOID SetDescriptionUsage(VOID)
VOID QueryDescriptionUsage(VOID)
VOID GetDisplayNameUsage(VOID)
VOID SetFailureUsage(VOID)
VOID EnumDependUsage(VOID)
VOID SetConfigUsage(VOID)
VOID InterrogateUsage(VOID)
VOID GetKeyNameUsage(VOID)