SteveManorHow to restart a windows service using VBScript

You can restart a windows service with the use of VBScript as shown in the below code snippet:

Set oshell = createobject(“Wscript.Shell“)
oshell.run”
cmd.exe
wscript.sleep
500
oshell.sendkeys “
net stop “”Your service name here“””+(“{Enter}”)
wscript.sleep
5000
oshell.sendkeys “
net start “”Your service name here“””+(“{Enter}”)
wscript.sleep
5000
oshell.sendkeys “
exit“+(“{Enter}”)

set oshell = nothing

WScript.Quit

`
http://www.all1press.com

http://www.all1tunes.com

Tags: , , ,