Wednesday 25 April 2012

Windows batch script to start or stop a windows service.

@echo off
net stop servicename
net start servicename

To reboot PC

shutdown /r /t 0

Stopping a service, may take time and if you want to run the file using scheduler it is good if you create two files with at least 5 min gap in between.