0% found this document useful (0 votes)
32 views2 pages

Create Automatic Windows Service - NSSM

This document outlines the steps to create an automatic Windows service using NSSM to run a monitoring script. It includes preparing the script, installing NSSM, configuring the service settings, starting the service, and performing additional checks for error logging and security. Thorough testing is recommended to ensure the service operates correctly.

Uploaded by

bharath.rit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

Create Automatic Windows Service - NSSM

This document outlines the steps to create an automatic Windows service using NSSM to run a monitoring script. It includes preparing the script, installing NSSM, configuring the service settings, starting the service, and performing additional checks for error logging and security. Thorough testing is recommended to ensure the service operates correctly.

Uploaded by

bharath.rit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Steps to create automatic windows service to run a monitoring script using NSSM

1. Prepare Your Script:

• Test your script: Ensure script runs correctly from the command line.

• Consider error handling: Implement error logging or notifications to troubleshoot issues.

• Set up necessary environment variables: If your script relies on specific environment


variables, ensure they're set correctly.

2. Install NSSM:

• Download the latest NSSM installer from the official website: NSSM - the Non-Sucking
Service Manager

• Change directory to folder containing nssm executable file

• Run the installer and follow the on-screen instructions.

Enter the following information:

o Path: The path to your script.

o Startup directory: The directory where your script is located.

o Name: The desired name for your service.

o Display Name: The name displayed in the Services console.

o Description: A brief description of the service.

Click the "Install Service" button.


Configure the Service

• Startup type: Choose the desired startup type e.g., Automatic

• Recovery options: Configure how the service should recover from failures.

• Log on as: Configure the user account under which the service will run.

Start the Service:

• Open the Services console (Start menu -> Administrative Tools -> Services).

• Find your service in the list and right-click to select "Start."

Additional Check:

• Error Logging: Configure your script to log errors to a file or send notifications via email or
other means.

• Service Recovery: Set up appropriate recovery actions, such as restarting the service or
sending notifications.

• Security: Ensure the service account has the necessary permissions to run the script and
access required resources.

• Testing: Thoroughly test the service to ensure it starts, stops, and restarts correctly.

Open msconfig -> startup -> make sure service is enabled at startup

You might also like