Home |  Page Index / Recent Changes / Access deniedRecently Commented | Search:
Login:     Password:   

  Bookmarks:   Page Index | Recent Changes | Access deniedRecently Commented | Access deniedUsers | Registration  
Print version :: Microsoft Word ready version

Sw4me: Winserv/CommandLine ...

This is an old revision of Winserv/CommandLine from 2004-11-06 18:06:57..

Contents

Command-line overview

The basic syntax for winserv invocation is the following:
One notable exception to this rule is the help subcommand that doesn't need any arguments (and ignores them, if any). Some subcommands (showconfig, status) accept more than one service name.

winserv install service-name service-options program args ...

creates a service that runs command (any executable) when started and stops when the program exits. Command-line parameters for the command may also be specified.

winserv configure service-name service-options program args ...

modifies various parameters for the service in SCM and registry databases. If the program is specified, it is stored in registry as a new program to be started by this winserv-based service.

winserv uninstall service-name

marks a service for deletion. When it is stopped and all its handles are closed, the service is removed from the SCM database.

winserv showconfig service-name1 service-name2 ...

shows the current service's parameters that may be modified with the configure subcommand. Some parameters make sense only for winserv-based services, and they will not be shown for other services (see parameters description below).

winserv stop service-name -nowait
winserv pause service-name -nowait
winserv continue service-name -nowait
winserv usercontrol service-name -code code

These subcommands send control signals to the running service. -nowait option means that the utility shouldn't wait until the service will report an appropriate status for the request (stopped for stop, paused for pause, running for continue).

winserv start service-name args ...

Starts the service using the given command-line arguments. If the service is winserv-based, the arguments are stored in the Service Args? environment variable.

winserv restart service-name args ...

Restarts the service, i.e. stops it, waits for it to be stopped, and then starts it with the arguments given.

winserv status service-name1 service-name2 ...

Prints out the current status of the services, one of: RUNNING, STOPPED, PAUSED, START_PENDING, PAUSE_PENDING, CONTINUE_PENDING, STOP_PENDING. The program's output is formatted like this:

You see that the program prints the list of SCM control signals that the service can accept now.

Service options

Using install and configure subcommands, you can specify parameters for the newly-created or configured service. Some of the service options require an argument. Here is the list of supported service options with arguments:

Winserv will refuse to set binary pathname and some winserv-specific options for non-winserv based services. Use -forceforeign option to suppress this behavior.


Use -expand option to store the application's command-line in registry as a REG_EXPAND_SZ type of value. In this case, all references to environment variables will be auto-expanded before starting the application:

Note that you have to use -expand with %Service Args?% to pass the service's command-line parameters as extra arguments.


 
There are no files on this page. [Display files/form]
There is no comment on this page. [Display comments/form]