Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenusage.c
Go to the documentation of this file.
00001 /* 00002 * PROJECT: ReactOS Services 00003 * LICENSE: GPL - See COPYING in the top level directory 00004 * FILE: base/system/sc/usage.c 00005 * PURPOSE: display usage info 00006 * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy@gmail.com> 00007 * 00008 */ 00009 #include "sc.h" 00010 00011 VOID MainUsage(VOID) 00012 { 00013 INT c; 00014 00015 _tprintf(_T("DESCRIPTION:\n") 00016 _T("\tSC is a command line program used for communicating with\n") 00017 _T("\tthe Service Control Manager and its services.\n") 00018 _T("USAGE:\n") 00019 _T("\tsc <server> [command] [service name] <option1> <option2>...\n") 00020 00021 _T("\tThe optional parameter <server> has the form \"\\ServerName\"\n") 00022 _T("\tFurther help on commands can be obtained by typing: \"sc [command]\"\n") 00023 _T("\tService Commands:\n") 00024 _T("\t query : Queries the status for a service, or\n") 00025 _T("\t enumerates the status for types of services.\n") 00026 _T("\t queryex : Queries the extended status for a service, or\n") 00027 _T("\t enumerates the status for types of services.\n") 00028 _T("\t start : Starts a service.\n") 00029 _T("\t pause : Sends a PAUSE control request to a service.\n") 00030 _T("\t interrogate : Sends a INTERROGATE control request to a service.\n") 00031 _T("\t continue : Sends a CONTINUE control request to a service.\n") 00032 _T("\t stop : Sends a STOP request to a service.\n") 00033 // "\t config : Changes the configuration of a service (persistant).\n" 00034 // "\t description : Changes the description of a service.\n" 00035 // "\t failure : Changes the actions taken by a service upon failure.\n" 00036 // "\t qc : Queries the configuration information for a service.\n" 00037 // "\t qdescription : Queries the description for a service.\n" 00038 // "\t qfailure : Queries the actions taken by a service upon failure.\n" 00039 _T("\t delete : Deletes a service (from the registry).\n") 00040 _T("\t create : Creates a service. (adds it to the registry).\n") 00041 _T("\t control : Sends a control to a service.\n")); 00042 // "\t sdshow : Displays a service's security descriptor.\n") 00043 // "\t sdset : Sets a service's security descriptor.\n") 00044 // "\t GetDisplayName : Gets the DisplayName for a service.\n") 00045 // "\t GetKeyName : Gets the ServiceKeyName for a service.\n") 00046 // "\t EnumDepend : Enumerates Service Dependencies.\n") 00047 // "\n") 00048 // "\tService Name Independant Commands:\n") 00049 // "\t boot : (ok | bad) Indicates whether the last boot should\n") 00050 // "\t be saved as the last-known-good boot configuration\n") 00051 // "\t Lock : Locks the SCM Database\n") 00052 // "\t QueryLock : Queries the LockStatus for the SCM Database\n") 00053 00054 _tprintf(_T("\nWould you like to see help for the QUERY and QUERYEX commands? [ y | n ]: ")); 00055 c = _getch(); // _gettch isn't defined in our tchar.h 00056 _tprintf(_T("%c\n"), c); 00057 if (tolower(c) == 'y') 00058 { 00059 _tprintf(_T("QUERY and QUERYEX OPTIONS :\n") 00060 _T(" If the query command is followed by a service name, the status\n") 00061 _T(" for that service is returned. Further options do not apply in\n") 00062 _T(" this case. If the query command is followed by nothing or one of\n") 00063 _T(" the options listed below, the services are enumerated.\n") 00064 _T(" type= Type of services to enumerate (driver, service, interact, all)\n") 00065 _T(" (default = service)\n") 00066 _T(" state= State of services to enumerate (inactive, all)\n") 00067 _T(" (default = active)\n") 00068 /* 00069 _T(" bufsize= The size (in bytes) of the enumeration buffer\n") 00070 _T(" (default = 4096)\n") 00071 _T(" ri= The resume index number at which to begin the enumeration\n") 00072 _T(" (default = 0)\n") 00073 _T(" group= Service group to enumerate\n") 00074 _T(" (default = all groups)\n") 00075 */ 00076 _T("SYNTAX EXAMPLES\n") 00077 _T("sc query - Enumerates status for active services & drivers\n") 00078 _T("sc query messenger - Displays status for the messenger service\n") 00079 _T("sc queryex messenger - Displays extended status for the messenger service\n") 00080 _T("sc query type= driver - Enumerates only active drivers\n") 00081 _T("sc query type= service - Enumerates only Win32 services\n") 00082 _T("sc query state= all - Enumerates all services & drivers\n") 00083 // _T("sc query bufsize= 50 - Enumerates with a 50 byte buffer.\n") 00084 // _T("sc query ri= 14 - Enumerates with resume index = 14\n") 00085 // _T("sc queryex group= "" - Enumerates active services not in a group\n") 00086 _T("sc query type= service type= interact - Enumerates all interactive services\n") 00087 _T("sc query type= driver group= NDIS - Enumerates all NDIS drivers\n")); 00088 } 00089 } 00090 00091 00092 VOID StartUsage(VOID) 00093 { 00094 _tprintf(_T("DESCRIPTION:\n") 00095 _T(" Starts a service running.\n") 00096 _T("USAGE:\n") 00097 _T(" sc <server> start [service name] <arg1> <arg2> ...\n")); 00098 } 00099 00100 00101 VOID PauseUsage(VOID) 00102 { 00103 _tprintf(_T("DESCRIPTION:\n") 00104 _T(" Sends a PAUSE control request to a service.\n") 00105 _T("USAGE:\n") 00106 _T(" sc <server> pause [service name]\n")); 00107 } 00108 00109 VOID InterrogateUsage(VOID) 00110 { 00111 _tprintf(_T("DESCRIPTION:\n") 00112 _T(" Sends an INTERROGATE control request to a service.\n") 00113 _T("USAGE:\n") 00114 _T(" sc <server> interrogate [service name]\n")); 00115 } 00116 00117 00118 VOID StopUsage(VOID) 00119 { 00120 _tprintf(_T("DESCRIPTION:\n") 00121 _T(" Sends a STOP control request to a service.\n") 00122 _T("USAGE:\n") 00123 _T(" sc <server> stop [service name]\n")); 00124 } 00125 00126 VOID ContinueUsage(VOID) 00127 { 00128 _tprintf(_T("DESCRIPTION:\n") 00129 _T(" Sends a CONTINUE control request to a service.\n") 00130 _T("USAGE:\n") 00131 _T(" sc <server> continue [service name]\n")); 00132 } 00133 00134 00135 VOID ConfigUsage(VOID) 00136 { 00137 _tprintf(_T("not yet implemented\n")); 00138 } 00139 00140 00141 VOID DescriptionUsage(VOID) 00142 { 00143 _tprintf(_T("DESCRIPTION:\n") 00144 _T(" Sets the description string for a service.\n") 00145 _T("USAGE:\n") 00146 _T(" sc <server> description [service name]\n")); 00147 } 00148 00149 VOID DeleteUsage(VOID) 00150 { 00151 _tprintf(_T("DESCRIPTION:\n") 00152 _T(" Deletes a service entry from the registry.\n") 00153 _T(" If the service is running, or another process has an\n") 00154 _T(" open handle to the service, the service is simply marked\n") 00155 _T(" for deletion.\n") 00156 _T("USAGE:\n") 00157 _T(" sc <server> delete [service name]\n")); 00158 } 00159 00160 VOID CreateUsage(VOID) 00161 { 00162 _tprintf(_T("Creates a service entry in the registry and Service Database.\n") 00163 _T("SYNTAX:\n") 00164 _T("sc create [service name] [binPath= ] <option1> <option2>...\n") 00165 _T("CREATE OPTIONS:\n") 00166 _T("NOTE: The option name includes the equal sign.\n") 00167 _T(" type= <own|share|interact|kernel|filesys|rec>\n") 00168 _T(" (default = own)\n") 00169 _T(" start= <boot|system|auto|demand|disabled>\n") 00170 _T(" (default = demand)\n") 00171 _T(" error= <normal|severe|critical|ignore>\n") 00172 _T(" (default = normal)\n") 00173 _T(" binPath= <BinaryPathName>\n") 00174 _T(" group= <LoadOrderGroup>\n") 00175 _T(" tag= <yes|no>\n") 00176 _T(" depend= <Dependencies(separated by / (forward slash))>\n") 00177 _T(" obj= <AccountName|ObjectName>\n") 00178 _T(" (default = LocalSystem)\n") 00179 _T(" DisplayName= <display name>\n") 00180 _T(" password= <password>\n")); 00181 } 00182 00183 VOID ControlUsage(VOID) 00184 { 00185 _tprintf(_T("DESCRIPTION:\n") 00186 _T(" Sends a CONTROL control request to a service.\n") 00187 _T("USAGE:\n") 00188 _T(" sc <server> control [service name] <value>\n")); 00189 } Generated on Sat May 26 2012 04:16:25 for ReactOS by
1.7.6.1
|