Run bat files as Windows Service with NSSM

I found NSSM on this StackOverflow link when I was searching for a tool to run bat files as windows service. It is really easy to use. I show you a simple usage, just follow the steps below.

Steps

  • Download and extract it
  • Open command window in the directory of nssm.exe
  • Type nssm install SimpleService
  • Set application path and display name for your batch file
  • Click Install Service

Here is my simple batch script

:loop

del "C:\SampleLogs\*.log"

goto loop
Written on August 26, 2016