+ Post New Thread
Results 1 to 5 of 5
Scripts Thread, VBS code to restart a service. in Coding and Web Development; Hi Does anybody know some code to restart a service using VBS please? Thanks...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,781
    Thank Post
    865
    Thanked 1,665 Times in 1,450 Posts
    Blog Entries
    11
    Rep Power
    442

    VBS code to restart a service.

    Hi

    Does anybody know some code to restart a service using VBS please?

    Thanks

  2. #2


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,686
    Thank Post
    352
    Thanked 794 Times in 714 Posts
    Rep Power
    346
    Google is your friend.

    Link.

  3. #3

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,781
    Thank Post
    865
    Thanked 1,665 Times in 1,450 Posts
    Blog Entries
    11
    Rep Power
    442
    Google just times out when i try here, not being very friendly at all

    Is it me, but i cant restart there.

  4. #4
    User3204's Avatar
    Join Date
    Aug 2006
    Location
    Wirral
    Posts
    769
    Thank Post
    55
    Thanked 66 Times in 62 Posts
    Rep Power
    34
    The command to do this is just "net start service" and "net stop service"

    But I guess you want to do it prettier than that: WMI and VBScript - Stop and Start Services with Win32_Service

  5. #5


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,686
    Thank Post
    352
    Thanked 794 Times in 714 Posts
    Rep Power
    346
    In my opinion you should stop the service AND then start it as seperate processes so you can look at the errorlevel etc should something occur.

    The link lists code to stop and code to start.

SHARE:
+ Post New Thread

Similar Threads

  1. Writing to Excel from .vbs script
    By Samson in forum Windows
    Replies: 6
    Last Post: 15th October 2008, 07:34 AM
  2. Restart when script completes
    By djones in forum Scripts
    Replies: 4
    Last Post: 18th May 2008, 10:26 PM
  3. Sub within a sub - VBS Script
    By FN-GM in forum Scripts
    Replies: 5
    Last Post: 18th May 2008, 06:30 PM
  4. Trace a VBS Script
    By chalkwellstu in forum Scripts
    Replies: 2
    Last Post: 25th January 2008, 10:53 AM
  5. VBS script for prestaging computers anyone?
    By ChrisH in forum Scripts
    Replies: 7
    Last Post: 23rd June 2006, 09:59 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •