Desktop shortcut to restart a windows service

Viewed 57527

Is it possible to create a windows desktop shortcut that will restart a windows service?

I'd like a button to restart my apache service after I have made changes to the config file.

3 Answers

You can do this in a batch file, then make a shortcut to it.

Create a text file with the following content, but save it with the file extension .bat

net stop "Service Name"
net start "Service Name"

Once the file exists, you can create a shortcut to it, and even assign a keyboard shortcut too if deemed necessary.

Related