One liner to restart service from CMD

Many times we want to restart services using command line (CMD) on windows. Here is the one liner which can be used 
to restart a service
runas /user:<localmachinename>\administrator cmd /c net stop "servicename" && net start "servicename"

I've included "runas" to ensure we have elevated / privilege access.
Advertisements