Click here to Skip to main content
13,042,819 members (86,501 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

19.8K views
2 bookmarked
Posted 2 Mar 2010

Restarting a windows service using VBScript

, 2 Mar 2010
Rate this:
Please Sign up or sign in to vote.
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 ...
 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

License

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

Share

About the Author

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

You may also be interested in...

Pro

Comments and Discussions

 
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170713.1 | Last Updated 3 Mar 2010
Article Copyright 2010 by Rudy du Plooy
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid