sc.exe config
Modifies the value of a service’s entries in the registry and in the Service Control Manager database.
Syntax
Parameters
Parameter | Description |
Specifies the name of the remote server on which the service is located. The name must use the Universal Naming Convention (UNC) format (for example, \myserver). To run SC.exe locally, don’t use this parameter. |
Specifies the service name returned by the getkeyname operation. |
type= > | Specifies the service type. The options include: - own — Specifies a service that runs in its own process. It doesn’t share an executable file with other services. This is the default value.
- share — Specifies a service that runs as a shared process. It shares an executable file with other services.
- kernel — Specifies a driver.
- filesys — Specifies a file system driver.
- rec — Specifies a file system-recognized driver that identifies file systems used on the computer.
- adapt — Specifies an adapter driver that identifies hardware devices such as keyboards, mice, and disk drives.
- interact — Specifies a service that can interact with the desktop, receiving input from users. Interactive services must be run under the LocalSystem account. This type must be used in conjunction with type= own or type= shared (for example, type= interacttype= own). Using type= interact by itself will generate an error.
|
start= | Specifies the start type for the service. The options include: - boot — Specifies a device driver that is loaded by the boot loader.
- system — Specifies a device driver that is started during kernel initialization.
- auto — Specifies a service that automatically starts each time the computer is restarted and runs even if no one logs on to the computer.
- demand — Specifies a service that must be started manually. This is the default value if start= is not specified.
- disabled — Specifies a service that cannot be started. To start a disabled service, change the start type to some other value.
- delayed-auto — Specifies a service that starts automatically a short time after other auto services are started.
|
error= | Specifies the severity of the error if the service fails to start when the computer is started. The options include: - normal — Specifies that the error is logged and a message box is displayed, informing the user that a service has failed to start. Startup will continue. This is the default setting.
- severe — Specifies that the error is logged (if possible). The computer attempts to restart with the last-known good configuration. This could result in the computer being able to restart, but the service may still be unable to run.
- critical — Specifies that the error is logged (if possible). The computer attempts to restart with the last-known good configuration. If the last-known good configuration fails, startup also fails, and the boot process halts with a Stop error.
- ignore — Specifies that the error is logged and startup continues. No notification is given to the user beyond recording the error in the Event Log.
|
binpath= | Specifies a path to the service binary file. There is no default for binpath=, and this string must be supplied. |
group= | Specifies the name of the group of which this service is a member. The list of groups is stored in the registry, in the HKLM\System\CurrentControlSet\Control\ServiceGroupOrder subkey. The default value is null. |
tag= | Specifies whether or not to obtain a TagID from the CreateService call. Tags are used only for boot-start and system-start drivers. |
depend= | Specifies the names of services or groups that must start before this service. The names are separated by forward slashes (/). |
obj= <| > | 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. The default setting is LocalSystem. |
displayname= | Specifies a descriptive name for identifying the service in user interface programs. For example, the subkey name of one particular service is wuauserv, which has a more friendly display name of Automatic Updates. |
password= |
Specifies a password. This is required if an account other than the LocalSystem account is used. /? Displays help at the command prompt.
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
To specify a binary path for the NewService service, type:
Конфигурация sc.exe sc.exe config
Изменяет значение записей службы в реестре и в базе данных диспетчера управления службами. Modifies the value of a service’s entries in the registry and in the Service Control Manager database.
Синтаксис Syntax
Параметры Parameters
Параметр Parameter | Описание Description |
Указывает имя удаленного сервера, на котором расположена служба. 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. |
Указывает имя службы, возвращенное операцией жеткэйнаме . Specifies the service name returned by the getkeyname operation. |
type= > | Указывает тип службы. Specifies the service type. Эти способы могут быть следующими: The options include: - собственный — указывает службу, которая выполняется в собственном процессе. own — Specifies a service that runs in its own process. Он не предоставляет доступ к исполняемому файлу другим службам. It doesn’t share an executable file with other services. Это значение по умолчанию. This is the default value.
- Share — указывает службу, которая выполняется как общий процесс. share — Specifies a service that runs as a shared process. Он использует исполняемый файл совместно с другими службами. It shares an executable file with other services.
- kernel — указывает драйвер. kernel — Specifies a driver.
- филесис — указывает драйвер файловой системы. filesys — Specifies a file system driver.
- REC — указывает драйвер, распознаваемый файловой системой, который определяет файловые системы, используемые на компьютере. rec — Specifies a file system-recognized driver that identifies file systems used on the computer.
- адаптация — указывает драйвер адаптера, который определяет устройства, такие как клавиатуры, мыши и диски. adapt — Specifies an adapter driver that identifies hardware devices such as keyboards, mice, and disk drives.
- взаимодействие — указывает службу, которая может взаимодействовать с рабочим столом и получать входные данные от пользователей. interact — Specifies a service that can interact with the desktop, receiving input from users. Интерактивные службы должны запускаться под учетной записью LocalSystem. Interactive services must be run under the LocalSystem account. Этот тип должен использоваться в сочетании с Type = владеть или Type = Shared (например, Type = взаимодействиеType = владеет). This type must be used in conjunction with type= own or type= shared (for example, type= interacttype= own). При использовании типа = взаимодействие само по себе вызывает ошибку. Using type= interact by itself will generate an error.
|
start= | Указывает тип запуска для службы. Specifies the start type for the service. Эти способы могут быть следующими: The options include: - Загрузка — указывает драйвер устройства, который загружается загрузчиком. boot — Specifies a device driver that is loaded by the boot loader.
- система — указывает драйвер устройства, который запускается во время инициализации ядра. system — Specifies a device driver that is started during kernel initialization.
- автоматически указывает службу, которая автоматически запускается при каждом перезапуске компьютера и выполняется, даже если никто из них не входит в систему. auto — Specifies a service that automatically starts each time the computer is restarted and runs even if no one logs on to the computer.
- Demand — указывает службу, которая должна быть запущена вручную. demand — Specifies a service that must be started manually. Это значение по умолчанию, если Start = не задано. This is the default value if start= is not specified.
- Disabled (отключено ) — указывает службу, которая не может быть запущена. disabled — Specifies a service that cannot be started. Чтобы запустить отключенную службу, измените тип запуска на другое значение. To start a disabled service, change the start type to some other value.
- отложенный — автоматически указывает службу, которая запускается автоматически через некоторое время после запуска других автоматических служб. delayed-auto — Specifies a service that starts automatically a short time after other auto services are started.
|
error= | Указывает серьезность ошибки, если служба не запускается при запуске компьютера. Specifies the severity of the error if the service fails to start when the computer is started. Эти способы могут быть следующими: The options include: - Обычная — указывает, что ошибка записывается в журнал и отображается окно сообщения, информирующее пользователя о том, что не удалось запустить службу. normal — Specifies that the error is logged and a message box is displayed, informing the user that a service has failed to start. Запуск будет продолжен. Startup will continue. Это параметр по умолчанию. This is the default setting.
- серьезная — указывает, что ошибка регистрируется (по возможности). severe — Specifies that the error is logged (if possible). Компьютер пытается перезапуститься с последней удачной конфигурацией. The computer attempts to restart with the last-known good configuration. Это может привести к тому, что компьютер сможет перезапуститься, но служба по-прежнему может не запуститься. This could result in the computer being able to restart, but the service may still be unable to run.
- критическая — указывает, что ошибка записывается в журнал (если возможно). critical — Specifies that the error is logged (if possible). Компьютер пытается перезапуститься с последней удачной конфигурацией. The computer attempts to restart with the last-known good configuration. Если последняя удачная конфигурация завершается сбоем, запуск также завершается сбоем, а процесс загрузки останавливается с ошибкой остановки. If the last-known good configuration fails, startup also fails, and the boot process halts with a Stop error.
- Ignore — указывает, что ошибка записывается в журнал, и запуск продолжится. ignore — Specifies that the error is logged and startup continues. Пользователю не выдается уведомление, кроме записи ошибки в журнал событий. No notification is given to the user beyond recording the error in the Event Log.
|
binpath= | Указывает путь к двоичному файлу службы. Specifies a path to the service binary file. Значение по умолчанию для BinPath =, и эта строка должна быть указана. There is no default for binpath=, and this string must be supplied. |
group= | Указывает имя группы, членом которой является эта служба. Specifies the name of the group of which this service is a member. Список групп хранится в реестре в подразделе хклм\систем\куррентконтролсет\контрол\сервицеграупордер . The list of groups is stored in the registry, in the HKLM\System\CurrentControlSet\Control\ServiceGroupOrder subkey. По умолчанию используется значение NULL. The default value is null. |
tag= | Указывает, следует ли получить TagID из вызова CreateService. Specifies whether or not to obtain a TagID from the CreateService call. Теги используются только для драйверов загрузки и запуска системы. Tags are used only for boot-start and system-start drivers. |
depend= | Указывает имена служб или групп, которые должны быть запущены перед этой службой. Specifies the names of services or groups that must start before this service. Имена разделяются косой чертой (/). The names are separated by forward slashes (/). |
obj= <| > | Указывает имя учетной записи, в которой будет выполняться служба, или задает имя объекта драйвера 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= | Указывает описательное имя для идентификации службы в программах пользовательского интерфейса. Specifies a descriptive name for identifying the service in user interface programs. Например, имя подраздела одной конкретной службы — wuauserv, которое имеет более понятное отображаемое имя автоматическое обновление. For example, the subkey name of one particular service is wuauserv, which has a more friendly display name of Automatic Updates. |
password= |
Указывает пароль. Specifies a password. Это необходимо, если используется учетная запись, отличная от учетной записи LocalSystem. This is required if an account other than the LocalSystem account is used. /? /? Отображение справки в командной строке. Displays help at the command prompt.
Каждый параметр командной строки (параметр) должен включать знак равенства как часть имени параметра. Each command-line option (parameter) must include the equal sign as part of the option name.
Между параметром и его значением требуется пробел (например, Type = an). A space is required between an option and its value (for example, type= own. Если пространство не указано, операция завершается ошибкой. If the space is omitted, the operation fails.
Примеры Examples
Чтобы указать путь к двоичному файлу для службы невсервице , введите: To specify a binary path for the NewService service, type: