Click here to Skip to main content
15,896,118 members
Articles / Programming Languages / VBScript

Restarting a windows service using VBScript

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
2 Mar 2010CPOL 28.7K   2  
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 ...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

No alternatives have been posted.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
South Africa South Africa
This member doesn't quite have enough reputation to be able to display their biography and homepage.

Comments and Discussions