Microsoft Windows

Start or Stop Windows Service using batch file

Start Windows Service
Open notepad and create a new file named for ex start_my_service.bat.

Paste in file the following lines:

@echo off
echo "starting my_service"
net start "my_service"
echo "done"
@echo on
 
pause

Save the file, right click on it and select “Run as administrator..” to run it!

Stop Windows Service
Open notepad and create a new file named for ex stop_my_service.bat.

Paste in file the following lines:

@echo off
echo "stopping my_service"
net stop "my_service"
echo "done"
@echo on
 
pause

Save the file, right click on it and select “Run as administrator..” to run it!