■Note■ Someone actually added me on MSN to ask the difference between this tool and the SC command under XP. It's really frustrating. 
Here's the clarification: First, a Windows service is not an ordinary executable program. For an application to become a service, it must call the standard Windows Service API according to the contract and interact correctly with the Windows Service Manager. For details, refer to:
http://msdn.microsoft.com/en-us/library/ms681921(VS.85).aspx and
http://msdn.microsoft.com/en-us/library/ms685967(VS.85).aspx. The detailed API reference is at: http://msdn.microsoft.com/en-us/library/ms685942(VS.85).aspx.
That is, the function of the SC command is to install, delete, start, and stop a service. While the function of runassrv is to turn any non-service program into a service.
If this is still not clear, try using SC to add a certain batch file or notepad.exe as a service and see what happens.
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
New content in version 1.1.0.628:
■ All Actions (such as: add / remove, etc.) do not need to add a prefix anymore.
■ New pause / continue operations.
■ From now on, a runassrv service can concurrently run multiple applications specified by /cmdline.
■ runassrv.exe itself does not need to be placed in the system search path.
■ New control operation to send a control code to the specified service.
■ New listsrv operation to list all services and drivers, supporting many filtering conditions.
■ New -logfile and -loglevel options, with log recording function.
■ New -unstoppable option, the system service manager will refuse to stop a service installed with this option.
■ Memory contraction strategy, typically with memory overhead less than 300KB.
■ Solved the problem that the start / stop command is invalid on some systems.
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
A small thing written a few years ago, for everyone's amusement~
Run As Service
A tool to run any executable file (including batch files and scripts) as a system service
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Introduction:
■ Run any executable file as a system service.
■ Originally mainly for porting some Linux daemons; can also be used to start any application and maintenance scripts.
■ Runs quietly, unless the Interactive mode is specified, no windows will pop up.
■ No need to log in, it runs automatically after the system starts, without waiting for the user to log in.
■ As a side function, it supports starting, stopping, and deleting any system service.
■ Completely take over the instructions of the system service manager (start, stop, etc.). After the running program terminates, it automatically submits the status to the service manager and exits by itself, without resident memory.
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Help screen:
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Simple Chinese help:
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Copyright: Free software; the author is not responsible for anything. You can use it for any purpose, as long as you don't do bad things
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Contact the author: http://www.cn-dos.net/forum or asbai@msn.com
Try to contact via the forum or email for things. But if you like playing StarCraft and are a noob with the same hand speed as me (no more than 100), welcome to add my MSN ^_^
[ Last edited by asbai on 2008-6-3 at 01:33 PM ]

Here's the clarification: First, a Windows service is not an ordinary executable program. For an application to become a service, it must call the standard Windows Service API according to the contract and interact correctly with the Windows Service Manager. For details, refer to:
http://msdn.microsoft.com/en-us/library/ms681921(VS.85).aspx and
http://msdn.microsoft.com/en-us/library/ms685967(VS.85).aspx. The detailed API reference is at: http://msdn.microsoft.com/en-us/library/ms685942(VS.85).aspx.
That is, the function of the SC command is to install, delete, start, and stop a service. While the function of runassrv is to turn any non-service program into a service.
If this is still not clear, try using SC to add a certain batch file or notepad.exe as a service and see what happens.
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
New content in version 1.1.0.628:
■ All Actions (such as: add / remove, etc.) do not need to add a prefix anymore.
■ New pause / continue operations.
■ From now on, a runassrv service can concurrently run multiple applications specified by /cmdline.
■ runassrv.exe itself does not need to be placed in the system search path.
■ New control operation to send a control code to the specified service.
■ New listsrv operation to list all services and drivers, supporting many filtering conditions.
■ New -logfile and -loglevel options, with log recording function.
■ New -unstoppable option, the system service manager will refuse to stop a service installed with this option.
■ Memory contraction strategy, typically with memory overhead less than 300KB.
■ Solved the problem that the start / stop command is invalid on some systems.
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
A small thing written a few years ago, for everyone's amusement~
Run As Service
A tool to run any executable file (including batch files and scripts) as a system service
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Introduction:
■ Run any executable file as a system service.
■ Originally mainly for porting some Linux daemons; can also be used to start any application and maintenance scripts.
■ Runs quietly, unless the Interactive mode is specified, no windows will pop up.
■ No need to log in, it runs automatically after the system starts, without waiting for the user to log in.
■ As a side function, it supports starting, stopping, and deleting any system service.
■ Completely take over the instructions of the system service manager (start, stop, etc.). After the running program terminates, it automatically submits the status to the service manager and exits by itself, without resident memory.
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Help screen:
C:\Documents and Settings\Administrator>
#runassrv
===========================================================================
Run As Service Ver 1.1.0.625 by BaiYang / 2004 - 2006, Freeware
===========================================================================
Run any program as a Service
USAGE: runassrv <Action> <Options>
===========================================================================
Actions:
add - Add a Service.
remove - Remove a Service.
start - Start a Service.
stop - Stop a Service.
pause - Pause a Service.
continue - Continue a paused Service.
control - Control a service by send it a op-code
listsrv - List all installed services on local system
listgrp - List all service load order groups on local system (by start
order).
-h - this screen
===========================================================================
Options:
-cmdline - when the service start, witch program you want to run.
-name - the service name.
-dispname - service's display name in service manager
-desc - service's description in service manager
DEFAULT: none
-type - service type, can be:
FileSystemDriver
KernelDriver
OwnProcess (DEFAULT)
ShareProcess
InteractiveProcess
NOTE: set this option incorrectly may endanger your system!
-starttype - service start type, can be:
SystemStart
BootStart
AutoStart (DEFAULT)
DemandStart
Disabled
NOTE: set this option incorrectly may endanger your system!
-errctl - service error control policy, can be:
ErrorIgnore
ErrorNormal (DEFAULT)
ErrorSevere
ErrorCritical
NOTE: set this option incorrectly may endanger your system!
-group - specify service load order group
DEFAULT: none
-depen - names of services or load ordering groups that the system
must start before this service, delimited by '/'
DEFAULT: none
-user - specifies the name of the account under which the service
should run.
DEFAULT: LocalSystem
-pass - contains the password to the account name
DEFAULT: none
-priority - priority of the program you want to run, can be:
Idle
BelowNormal
Normal (DEFAULT)
AboveNormal
High
RealTime
-unstoppable - make service unstoppable by system service control manager.
-opcode - for "control", specify the operation code.
-logfile - specify the logging target.
DEFAULT: don't log to file.
-loglevel - specify the lowest logging level, can be:
DebugOnly (Most Detail)
Info
Warning
Error (DEFAULT)
FatalError
Disabled (Close Logging Output)
===========================================================================
Special Options With "listsrv":
-name - list service name that match the wildcard pattern
DEFAULT: *
-dispname - service display name's wildcard pattern.
DEFAULT: *
-pid - service belong to specified process.
DEFAULT: any
-type - specify service types to be match, delimite by "/".
DEFAULT: any
-starttype - specify service starttypes to be match, delimite by "/".
DEFAULT: any
-group - service belong to the load order group
DEFAULT: any
-state - service's current state, can be:
active
inactive
DEFAULT: any
===========================================================================
Examples:
runassrv add /cmdline:"c:\tools\myapp.exe -arg1 -arg2" /name:"mysrv"
runassrv add /cmdline:myapp.exe /cmdline:yourapp.exe /name:mysrv
runassrv add /cmdline:notepad /cmdline:vi.bat /type:interactiveprocess /priority:AboveNormal /name:testsrv /logfile:C:\test.log /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.0.628 by BaiYang / 2004 - 2006, Freeware
===========================================================================
Run any executable program as a system service
Usage: runassrv <action> <options>
===========================================================================
Actions:
add - Add a service.
remove - Remove a service.
start - Start a service.
stop - Stop a service.
pause - Pause a service
continue - Continue a paused service.
control - Send a control code to the specified service.
listsrv - List all services and drivers that meet the conditions on the current system.
listgrp - List the priority order of all service startup groups on 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, each specifying an application to run. When the service starts, these applications will be executed concurrently.
-name - Specify the system service name (used for system operations such as net start, etc.).
-dispname - Specify the service display name that the user will see (the name seen in the service manager).
-desc - Specify the service description (the service description information seen in the service manager)
Default: None
-type - Specify the service type, which can be the following types:
FileSystemDriver : File system and driver, will be loaded before the kernel is loaded. Note that services at this level can hardly use any system APIs.
KernelDriver : Kernel-level driver, loaded immediately after the kernel is loaded. Services at this level can only use restricted APIs.
OwnProcess : Separate process service, standard service, started after the Win32 subsystem is ready, default.
ShareProcess : Shared process service, that is, several services share the same process. Many services relying on svchost use this type.
InteractiveProcess: Interactive service, the service can interact with the user. Except for this type, all other types of services cannot have a user-visible interface.
Note: Incorrectly setting this option may make the system unstable or even unable to start! If you don't know what you are doing, please don't try the first two items.
-starttype - Service startup type, including:
SystemStart : System-level startup, started after the kernel is initialized.
BootStart : Started by the system loader (before the kernel is initialized).
AutoStart : Start automatically, started after the Win32 subsystem is initialized, default.
DemandStart : Manual.
Disabled : Disabled.
Note: Incorrectly setting this option may make the system unstable or even unable to start! If you don't know what you are doing, please don't try the first two items.
-errctl - Specify the error handling strategy when the service has an error, which can be:
ErrorIgnore : Ignore the error, do not rescue the service, the system continues to run
ErrorNormal : Record to the system log and pop up a dialog box to prompt the user, default. (Default)
ErrorSevere : Record the log and pop up a prompt box. If the current system has run in the last correct startup configuration, ignore the error, otherwise automatically restart to the last correct configuration.
ErrorCritical : The same as above, but if restarting to the last correct configuration still fails to start this service, it will blue screen.
Note: Incorrectly setting this option may make the system unstable or even unable to start! If you 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 by listgrp.
Default: None
-depen - Specify the services that this service depends on. The services specified here must be started correctly before this service starts. Multiple services are separated by "/". Here, the system service name must be specified, not the name seen by the user.
Default: None
-user - Specify the user identity, that is, the user account that this service uses to run
Default: LocalSystem (local system, highest authority), interactive services must use this account.
-pass - Specify the user password
Default: None (LocalSystem)
-priority - The running priority of the program specified by the cmdline parameter, which can be (no need to explain this):
Idle
BelowNormal
Normal (Default)
AboveNormal
High
RealTime
-unstoppable - The system service manager will refuse to stop the service installed with this option.
-opcode - Specify the control code to be sent for the control command. The control code "1" is actually equivalent to the stop command, used to stop the service. Except for a few standard control codes, most control codes correspond to behaviors defined by the service itself.
-logfile - Specify the log file
Default: Do not record the log file
-loglevel - Specify the detail level of log recording, which can be:
DebugOnly (record all running details)
Info
Warning
Error (Default)
FatalError
Disabled (Close the log output to the console and file)
===========================================================================
Special options when using the listsrv command:
-name - Specify the wildcard of the service name to be listed
Default: *
-dispname - Specify the wildcard of the service display name to be listed
Default: *
-pid - Only list services running in the specified process
Default: All processes
-type - Only list services of the specified type, multiple service types are separated by "/"
Default: All types
-starttype - Only list services of the specified startup type, multiple types are separated by "/"
Default: All types
-group - Only list services in the specified startup group
Default: Any group
-state - Only list services whose current state meets the specified value, which can be:
active : The service is currently in an active state (starting, running, etc.)
inactive : The service is currently in an inactive state (stopped)
Default : Any
===========================================================================
Examples:
runassrv add /cmdline:"c:\tools\myapp.exe -arg1 -arg2" /name:"mysrv"
runassrv add /cmdline:myapp.exe /cmdline:yourapp.exe /name:mysrv
runassrv add /cmdline:notepad /cmdline:vi.bat /type:interactiveprocess /priority:AboveNormal /name:testsrv /logfile:C:\test.log /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 the separator of commands and parameters:
All parameters are prefixed with "-" or "/"; parameters that need to be assigned use ":" or "=" as the assignment operator, for example: -name="mysrv"; /name:"mysrv"; -name:"mysrv", etc. combinations are all legal.
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Copyright: Free software; the author is not responsible for anything. You can use it for any purpose, as long as you don't do bad things

≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Contact the author: http://www.cn-dos.net/forum or asbai@msn.com
Try to contact via the forum or email for things. But if you like playing StarCraft and are a noob with the same hand speed as me (no more than 100), welcome to add my MSN ^_^
[ Last edited by asbai on 2008-6-3 at 01:33 PM ]
Recent Ratings for This Post
( 10 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| qzwqzw | +15 | 2007-03-15 08:40 |
| JohnsonHE | +1 | 2007-04-29 23:33 |
| tashaxin | +2 | 2007-05-22 21:16 |
| chainliq | +3 | 2007-06-01 04:37 |
| xiaoshuq | +2 | 2007-10-13 11:41 |
| 523066680 | +15 | 2009-01-23 14:59 |
| — | +1 | 2010-10-12 17:39 |
| sky96111 | +1 | 2016-01-08 23:02 |
| zzkwhl | +1 | 2017-08-13 07:43 |
| zzz19760225 | +2 | 2018-04-04 11:49 |
Attachments

DigestI

Actually, the original text has some special symbols like "" which may not be properly displayed, but the translation for the rest is as above. And the last sentence "能不能麻烦Wengier兄给个故障重现的步骤?;" is translated to "Can you trouble Brother Wengier to give a step to reproduce the fault? 