Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create dummy windows server with started status

I have created a dummy windows service using the following command:

sc create TestService binPath= C:\Temp\TestService.exe DisplayName= "TestService " start= auto

It successfully created a dummy service in services.msc but I would also need it to show a 'Started' status. I know this will require a bit of coding and my TestService.exe is blank.

Any idea how? I searched thru the net and it requires MS Visual Studio 2010 etc. Looks too complicated, all I need is a blank service that shows a 'Started' status that will be used for testing purpose.

like image 580
lulala Avatar asked Jan 09 '14 01:01

lulala


1 Answers

  1. Create a dummy.bat file in C:\ with contents "pause"
  2. Download NSSM from http://www.nssm.cc/download
  3. Extract nssm.exe (x86 or x64) to C:\Windows\nssm.exe
  4. Run "nssm install"
  5. Path: C:\dummy.bat
  6. Service name - As you wish!
  7. Hit "Install service"

After that, you'll have a service named after step 6, which you can start, stop, restart...

Hope it helps!

like image 133
Helvio Avatar answered Nov 15 '22 22:11

Helvio