sc.exe 作成sc.exe create
サブキーとサービスのエントリをレジストリおよびサービス コントロール マネージャー データベースを作成します。Creates a subkey and entries for a service in the registry and in the Service Control Manager database.
構文Syntax
sc.exe [<servername>] create [<servicename>] [type= {own | share | kernel | filesys | rec | interact type= {own | share}}] [start= {boot | system | auto | demand | disabled | delayed-auto}] [error= {normal | severe | critical | ignore}] [binpath= <binarypathname>] [group= <loadordergroup>] [tag= {yes | no}] [depend= <dependencies>] [obj= {<accountname> | <objectname>}] [displayname= <displayname>] [password= <password>]
パラメーターParameters
パラメーターParameter | 説明Description |
---|---|
<servername> |
サービスが配置されているリモート サーバーの名前を指定します。Specifies the name of the remote server on which the service is located. 名前には、汎用名前付け規則 (UNC) 形式 (myserver など) を使用する必要があり \ ます。The name must use the Universal Naming Convention (UNC) format (for example, \myserver). SC.exe をローカルで実行するには、このパラメーターを使用しないでください。To run SC.exe locally, don't use this parameter. |
<servicename> |
によって返されるサービスの名前を指定、 られて 操作します。Specifies the service name returned by the getkeyname operation. |
type= {own | share | kernel | filesys | rec | interact type= {own | share}} |
サービスの種類を指定します。Specifies the service type. 選択肢は次のようになっています。The options include:
|
start= {boot | system | auto | demand | disabled | delayed-auto} |
サービスの開始の種類を指定します。Specifies the start type for the service. 選択肢は次のようになっています。The options include:
|
error= {normal | severe | critical | ignore} |
コンピューターの起動時にサービスを開始できない場合のエラーの重大度を指定します。Specifies the severity of the error if the service fails to start when the computer is started. 選択肢は次のようになっています。The options include:
|
binpath= <binarypathname> |
サービスのバイナリ ファイルへのパスを指定します。Specifies a path to the service binary file. 既定値はありません binpath =, 、この文字列を提供する必要があります。There is no default for binpath=, and this string must be supplied. |
group= <loadordergroup> |
このサービスがメンバーになっているグループの名前を指定します。Specifies the name of the group of which this service is a member. グループの一覧が、レジストリに格納されている、 HKLM\System\CurrentControlSet\Control\ServiceGroupOrder サブキー。The list of groups is stored in the registry, in the HKLM\System\CurrentControlSet\Control\ServiceGroupOrder subkey. 既定値は、null です。The default value is null. |
tag= {yes | no} |
CreateService 呼び出し、TagID で取得するかどうかを指定します。Specifies whether or not to obtain a TagID from the CreateService call. タグは、ブート開始またはシステム開始ドライバーに対してだけ使用されます。Tags are used only for boot-start and system-start drivers. |
depend= <dependencies> |
サービスまたはこのサービスの前に、まずグループの名前を指定します。Specifies the names of services or groups that must start before this service. 名前は、スラッシュ (/) で区切られます。The names are separated by forward slashes (/). |
obj= {<accountname> | <objectname>} |
サービスが実行されますが、またはドライバーを実行する Windows ドライバー オブジェクトの名前を指定するアカウントの名を指定します。Specifies a name of an account in which a service will run, or specifies a name of the Windows driver object in which the driver will run. 既定の設定は LocalSystem します。The default setting is LocalSystem. |
displayname= <displayname> |
ユーザーインターフェイスプログラムでサービスを識別するためのフレンドリ名を指定します。Specifies a friendly name for identifying the service in user interface programs. たとえば、1 つの特定のサービスのサブキーの名前は wuauserv, 、自動更新のわかりやすい表示名を持ちます。For example, the subkey name of one particular service is wuauserv, which has a more friendly display name of Automatic Updates. |
password= <password> |
パスワードを指定します。Specifies a password. ローカル システム アカウント以外のアカウントを使用する場合に必要です。This is required if an account other than the LocalSystem account is used. |
/?/? | コマンド プロンプトにヘルプを表示します。Displays help at the command prompt. |
解説Remarks
各コマンドラインオプション (パラメーター) には、オプション名の一部として等号を含める必要があります。Each command-line option (parameter) must include the equal sign as part of the option name.
スペースは、オプションとその値の間で必要な (たとえば、 型 = 独自 します。A space is required between an option and its value (for example, type= own. スペースを省略した場合、操作は失敗します。If the space is omitted, the operation fails.
例Examples
Newservice サービスの新しいバイナリパスを作成して登録するには、次のように入力します。To create and register a new binary path for the NewService service, type:
sc.exe \\myserver create NewService binpath= c:\windows\system32\NewServ.exe
sc.exe create NewService binpath= c:\windows\system32\NewServ.exe type= share start= auto depend= +TDI NetBIOS