+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, Service start and stop in Coding and Web Development; Hi guys A really easy one for the experts out there, I am trying to write a really simple script ...
  1. #1
    JPS
    JPS is offline
    JPS's Avatar
    Join Date
    May 2010
    Location
    Chelmsford
    Posts
    293
    Thank Post
    91
    Thanked 44 Times in 40 Posts
    Rep Power
    12

    Service start and stop

    Hi guys

    A really easy one for the experts out there,

    I am trying to write a really simple script as a batch file that can be ran as a scheduled task. I want one script to stop a service and another to start a service. I have used the following but it doesnt work:

    NET STOP

    "Facility Data Server"

    Pause
    (I added the pause so I could see what was going wrong)

    I presume I have missed something somewhere. Could someone please advise?

    PS I have triple checked I have the service name correct and that it is running.

    Please see attachment for the error.

    Thanks in advanceservice_stop_error.JPG

  2. #2

    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead
    Posts
    17,684
    Thank Post
    516
    Thanked 2,453 Times in 1,899 Posts
    Blog Entries
    24
    Rep Power
    833
    The syntax is Net Stop "Facility Data Server" without any carriage returns in between.

  3. Thanks to localzuk from:

    JPS (5th November 2010)

  4. #3

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,808
    Thank Post
    272
    Thanked 1,135 Times in 1,031 Posts
    Rep Power
    349
    Yeah all has to be on the same line

  5. #4
    JPS
    JPS is offline
    JPS's Avatar
    Join Date
    May 2010
    Location
    Chelmsford
    Posts
    293
    Thank Post
    91
    Thanked 44 Times in 40 Posts
    Rep Power
    12
    Cheers guys, probably the most simple mistake to make, however in my defence, isnt it really daft that in that dos window it shows the example format at NET STOP and then 'service' on a new line??

    Thanks, I now have nice and easy service restarts!

SHARE:
+ Post New Thread

Similar Threads

  1. Start a disabled service using server 2008 GPO
    By FN-GM in forum Windows Server 2008
    Replies: 4
    Last Post: 12th March 2009, 10:13 PM
  2. SpaceGuard - Service Wont Start Please Help
    By EduTech in forum General Chat
    Replies: 2
    Last Post: 22nd October 2008, 04:29 PM
  3. MSI fails to start service
    By Lithium in forum Windows
    Replies: 3
    Last Post: 23rd June 2008, 03:36 PM
  4. Replies: 5
    Last Post: 14th May 2008, 12:43 PM
  5. SMTP Service (Exchange Server) will not stop
    By mrforgetful in forum Windows
    Replies: 5
    Last Post: 16th January 2008, 10:13 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
  •