How to restart a service via a batch file

Reading Time: < 1 minute

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.

3 thoughts on “How to restart a service via a batch file

  1. Dear Sir,

    I wanna asked a question that how can we restart a services by using .Bat files at another user of this services.

    Regards,
    Ankur K

  2. Please note the example is wrong, as it uses the wrong quotes.

    Do NOT copy-paste the example, you must use standard unicode “straight” quotes like this:

    net stop “Service”
    net start “Service”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.