To restart a service via a batch file, open a blank notepad file.
type net stop “servicename”
type net start “servicename”
For example, you would stop the printer spooler service by typing:
net stop “Print Spooler”
net start “Print Spooler”
Once done, save the file with a .bat extension. Example restart.bat
Note: You may need to re enter the speech marks if you were to copy the above command into a notepad.