Using nprwinservice to Maintain Windows Services of Entire System Server

#### Search Results

Search

# Using nprwinservice to Maintain Windows Services of Entire System Server

`nprwinservice` is a tool that can be used to maintain the Windows services of Entire System Server. It must be executed from a Windows command prompt with administrator privileges.

To access `nprwinservice`

1. In the command prompt enter "<INSTALLDIR>\EntireSystemServer\bin\nprwinservice"

   The utility `nprwinservice` is started. When invoked without parameters, a list of possible parameters is now displayed.

- Usage in BAT files

- Functions

- Parameters

- Exit Code

- Software AG Installer ID

- Examples

- Naming Conventions

## Usage in BAT files

`nprwinservice` can be used in BAT files too, as it does not interact with the caller. It is highly recommended to check the exit code of `nprwinservice` in BAT files.

## Functions

    nprwinservice /add <npr_service> using <npr_service_template>

Adds a Windows service for <npr_service> using the template <npr_service_template>

    nprwinservice /add <npr_service> [id <id>] exe
            <full qualified name of npretb.exe>

Adds a Windows service for <npr_service> [with SAG Installer ID <id>] for the executable <full qualified name of npretb.exe>

    nprwinservice /delete <npr_service> [path <path prefix>]

Delete Windows service for <npr_service> (service: wildcard possible) (optional: path prefix selection)

    nprwinservice /list <npr_service> [path <path prefix>]
            [autostart]

List NPR Windows service(s) (service: wildcard possible) (optional: path prefix selection)

    nprwinservice /start <npr_service> [path <path prefix>]
            [autostart]

Start NPR Windows service(s) (service: wildcard possible) (optional: path prefix selection)

    nprwinservice /stop <npr_service> [path <path prefix>]
            [autostart]

Stop NPR Windows service(s) (service: wildcard possible) (optional: path prefix selection)

## Parameters

Parameter | Description
--- | ---
`autostart` (optional) | Handle only NPR service(s) with start type 'automatic'.
`<id>` (optional) | SAG Installer ID. It will be appended in brackets to the Windows service name for uniqueness. If the file <InstallDir>\EntireSystemServer\nprinstall.ini exists, and if `<id>` is not specified, the SAG Installer ID will be taken from there.

## Exit Code

`nprwinservice` returns exit code 0 (zero), if the function was performed successfully. In all other cases (e.g. if a service could not be found), the exit code is not equal 0 (zero).

The exit code is always being written to the output of `nprwinservice` also. See Examples.

## Software AG Installer ID

NPR Windows service names may contain a Software AG installer ID as suffix. For example: `NPR_npr_pcxyz01 (123)`.

Such names must be enclosed in double quotes in the `nprwinservice` command. See Examples.

## Examples

The examples are shown with output.

#### List all NPR Windows services defined on the current Windows system:

    nprwinservice /list

    Windows service NPR_npr_pcxyz01
    ... state: running - autostart: yes
    Windows service NPR_npr_pcxyz01 (10001)
    ... state: stopped - autostart: no
    Windows service NPR_npr_t01
    ... state: stopped - autostart: no
    Windows service NPR_npr_t01 (20000)
    ... state: stopped - autostart: no
    4 service(s) listed
    Exit code 0

#### List the NPR Windows services, which are started automatically during Windows startup:

    nprwinservice /list * autostart

    Windows service NPR_npr_pcxyz01
    ... state: running - autostart: yes
    1 service(s) listed
    Exit code 0

#### Adding a new NPR Windows service, by cloning an existing service, using the SAG Installer ID:

    nprwinservice /add npr_pcxyz01_02 using npr_pcxyz01

    Reading C:\SoftwareAG\EntireSystemServer\nprinstall.ini
    INSTALLER_ID=1
    Windows service NPR_npr_pcxyz01_02 (1) added
    Exit code 0

#### Adding a new NPR Windows service, by cloning an existing service, without usage of the SAG Installer ID:

    nprwinservice /add npr_pcxyz01_03 id none using npr_pcxyz01

    Windows service NPR_npr_pcxyz01_03 added
    Exit code 0

#### Deleting an NPR Windows service:

    nprwinservice /delete "npr_pcxyz01_02 (1)"

    Windows service NPR_npr_pcxyz01_02 (1) deleted
    Exit code 0

#### Starting an NPR Windows service:

    nprwinservice /start npr_pcxyz01

    Windows service NPR_npr_pcxyz01 started
    1 service(s) started
    Exit code 0

    nprwinservice /start npr_pcxyz01

    Windows service NPR_npr_pcxyz01 is running already
    0 service(s) started
    Exit code 1

#### Stopping an NPR Windows service:

    nprwinservice /stop npr_pcxyz01

    Windows service NPR_npr_pcxyz01 stop pending - waiting 10 seconds
    Windows service NPR_npr_pcxyz01 stop pending - waiting 10 seconds
    Windows service NPR_npr_pcxyz01 stop pending - waiting 10 seconds
    Windows service NPR_npr_pcxyz01 stopped
    1 service(s) stopped
    Exit code 0

Notes:

1. It may take some time, until the Windows service stopping is performed.
2. If you define a new NPR Windows service, for example by copying, you must make sure that the related NPR Broker service definition exists in the npr.ini file.

## Naming Conventions

The NPR Windows service names are derived from the NPR EntireX Broker service names by adding the prefix NPR_ to the existing EntireX Broker service names.

For example, if the existing EntireX Broker service name is npr_sample01, the derived Windows service name would be NPR_npr_sample01.

If a Windows service name is not prefixed by NPR_ in any nprwinservice command, the prefix NPR_ is being set automatically.

#### Example

The command

    nprwinservice /list npr_pcxyz01

is equivalent to

    nprwinservice /list NPR_npr_pcxyz01

### On this page

- Usage in BAT files
- Functions
- Parameters
- Exit Code
- Software AG Installer ID
- Examples
- Naming Conventions