Examples:
runassrv add /cmdline:"c:\tools\ -arg1 -arg2" /name:"mysrv"
runassrv add /cmdline: /cmdline: /name:mysrv
runassrv add /cmdline:notepad /cmdline: /type:interactiveprocess /priority:AboveNormal /name:testsrv /logfile:C:\ /loglevel:debugonly /dispname:"My Test Service" /desc:"This is a Test Service"
runassrv start /name:wuauserv
runassrv stop /name:wuauserv
runassrv pause /name:iisadmin
runassrv control /name:wuauserv /opcode:1
runassrv listsrv /name:w*
runassrv listsrv /type:KernelDriver/FileSystemDriver
runassrv listsrv /starttype:SystemStart/BootStart
runassrv listsrv /group:pnp_tdi
runassrv listsrv /pid:1234
runassrv listgrp
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Simple Chinese help:
C:\Documents and Settings\Administrator>
#runassrv
===========================================================================
Run As Service Ver 1.1.2.803 by BaiYang / 2004 - 2006, Freeware
===========================================================================
Run any executable program as a system service
Usage: runassrv <action> <option>
===========================================================================
action:
add -Add a new service.
remove - Delete a service.
start - Start a service.
stop - Stop a service.
pause - Suspend a service
continue - Continue a suspended service.
control -Send a control code to the specified service.
listsrv - List all services and drivers in the current system that meet the conditions.
listgrp - List the priority order of all service startup groups in the current system.
-h - This help screen.
===========================================================================
Options:
-cmdline - When the service starts, specify which program you really want to run. This option can be used multiple times
Use, each specify an application to run. When the service starts, these applications will be concurrent
Execute in place.
-name -Specify the system service name (for system operations such as net start ).
-dispname -Specify the service display name (the name seen in the service manager) that the user will see.
-desc -Specify service description (service description information seen in the service manager)
Default: None
-type - Specify the service type, which can be the following:
FileSystemDriver : The file system and driver will be loaded before the kernel is loaded. Note
Services of this level can hardly use any system API.
KernelDriver �
Level services can only use restricted APIs.
OwnProcess: Individual process service, standard service, ready in Win32 subsystem
After startup, default.
ShareProcess: Shared process services, that is, several services share the same process, many
Services that rely on svchost use this type.
InteractiveProcess: Interactive service, the service can interact with users, in addition to this class
Except for the type, all types of services cannot be user-friendly.
The interface to see.
Note: This option incorrectly sets this option may make the system unstable and even fail to start! if
Don’t know what you are doing, please don’t try the first two items.
-starttype -Service startup type, including:
SystemStart: System-level startup, start after kernel initialization.
BootStart: Started by the system loader (before kernel initialization).
AutoStart: Automatically start, start after Win32 subsystem is initialized, default.
DemandStart: Manual.
Disabled
Note: This option incorrectly sets this option may make the system unstable and even fail to start! if
Don’t know what you are doing, please don’t try the first two items.
-errctl -Specify the error handling policy when a service error occurs, which can be:
ErrorIgnore: Ignore errors, do not rescue the service, the system continues to run
ErrorNormal: Record the system log, and a dialog box pops up to prompt the user to silently
recognize. (default)
ErrorSevere : Log a log and a prompt box pops up, if the current system is already running
The configuration that was started correctly for the last time will be ignored, otherwise it will be automatically
Restart until the last correct configuration.
ErrorCritical: Same as above, but if you restart until the last correct configuration, it will still be started
If the service fails, the blue screen will be displayed.
Note: This option incorrectly sets this option may make the system unstable and even fail to start! if
Don’t know what you are doing, please don’t try the last two items.
-group - Specify the startup priority group that the service belongs to. The priority group can be listed in order through listgrp.
Default: None
-depen -Specify the service to which this service depends. The service specified here must be correct before the service is started.
start up. Multiple services are divided by "/". Here you need to specify the system service name, not the user
The name I saw.
Default: None
-user -Specify the user identity, that is, which user account is used for this service to run
Default: LocalSystem (local system, highest permission), interactive services must use this
account number.
-pass -Specify user password
Default: None (LocalSystem)
-priority -cmdline The parameter specifies the program's running priority, which can be (this one needs no explanation):
Idle
BelowNormal
Normal (default)
AboveNormal
High
RealTime
-unstoppable - The system service manager will refuse to stop the services installed with this option.
-opcode - Specify the control code to be sent for the control command. Control code "1" is actually equivalent to command
stop, used to stop the service. In addition to several standard control codes, most control codes correspond to
Behavior is defined by the service itself.
-logfile -Specify log file
Default: No log files are recorded
-loglevel -Specify the level of detail of logging, which can be:
DebugOnly (record all operation details)
Info
Warning
Error (default)
FatalError
Disabled (Close log output to console and files)
===========================================================================
Special options when using the listsrv command:
-name -Specify the service name wildcard to be listed
default: *
-dispname -Specify the service display name wildcard to be listed
default: *
-pid - Only list services running in the specified process
Default: All processes
-type - Only list the services of the specified type, use "/" to split between multiple service types
Default: All types
-starttype - Only list services with the specified startup type, use "/" to split between multiple types
Default: All types
-group - Into list the services located in the specified startup group
Default: any group
-state - Only services whose current status meets the specified value can be:
Active: The service is currently active (starting, running, etc.)
inactive: The service is currently inactive (stopped)
Default
===========================================================================
example:
runassrv add /cmdline:"c:\tools\ -arg1 -arg2" /name:"mysrv"
runassrv add /cmdline: /cmdline: /name:mysrv
runassrv add /cmdline:notepad /cmdline: /type:interactiveprocess /priority:AboveNormal /name:testsrv /logfile:C:\ /loglevel:debugonly /dispname:"My Test Service" /desc:"This is a Test Service"
runassrv start /name:wuauserv
runassrv stop /name:wuauserv
runassrv pause /name:iisadmin
runassrv control /name:wuauserv /opcode:1
runassrv listsrv /name:w*
runassrv listsrv /type:KernelDriver/FileSystemDriver
runassrv listsrv /starttype:SystemStart/BootStart
runassrv listsrv /group:pnp_tdi
runassrv listsrv /pid:1234
runassrv listgrp
===========================================================================
About command and parameter separator:
All parameters are prefixed with "-" or "/"; the value parameter needs to be assigned with ":" or "=" as
Assignment operators, such as: -name="mysrv"; /name:"mysrv"; -name:"mysrv" and other combinations
It is legal.