+ Post New Thread
Results 1 to 9 of 9
Scripts Thread, Shutdown batch script stalls if 1 PC is shut down in Coding and Web Development; Hi there. Currently I am using a batch file consisting of a list of shutdown commands to shutdown our ICT ...
  1. #1

    Join Date
    Sep 2006
    Location
    Cornwall
    Posts
    135
    Thank Post
    7
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Shutdown batch script stalls if 1 PC is shut down

    Hi there.

    Currently I am using a batch file consisting of a list of shutdown commands to shutdown our ICT suite (17 PC's all XP SP2). I am finding that if one of the PC's has been shutdown prior to the batch file running the batch file hangs at the command to shutdown that PC.

    Has anybody got a solution/command/workaround that will ignore/skip PC's that are already shutdown? I know its only 17 PC's and they're all in 1 room but I want to run the script as a scheduled task.

    Any ideas welcome!

  2. #2
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,993
    Thank Post
    120
    Thanked 286 Times in 263 Posts
    Rep Power
    108

    Re: Shutdown batch script stalls if 1 PC is shut down

    Parse the output of a ping command to see if host is alive before thtryingt o shut it down.

  3. #3

    Join Date
    Jan 2006
    Location
    Surburbia
    Posts
    2,178
    Thank Post
    74
    Thanked 307 Times in 243 Posts
    Rep Power
    115

    Re: Shutdown batch script stalls if 1 PC is shut down

    Much of a muchness, but if it's a script, I think it's slightly nicer to use a WMI Win32_PingStatus query

  4. #4
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: Shutdown batch script stalls if 1 PC is shut down

    One possible way around this would be to add a scheduled task on each PC to perform a shutdown at a specific time. This could be installed/managed from a startup script.

  5. #5


    Join Date
    Oct 2006
    Posts
    3,414
    Thank Post
    184
    Thanked 356 Times in 285 Posts
    Rep Power
    149

    Re: Shutdown batch script stalls if 1 PC is shut down


  6. #6
    Guest

    Re: Shutdown batch script stalls if 1 PC is shut down


  7. #7

    Join Date
    Sep 2006
    Location
    Cornwall
    Posts
    135
    Thank Post
    7
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Shutdown batch script stalls if 1 PC is shut down

    Cheers guys! I tried the psshutdown and it works great, now just gotta implement WoL to get them back up automatically...

  8. #8
    mrcrazy04's Avatar
    Join Date
    Nov 2006
    Location
    Bedfordshire/Cheltenham, UK
    Posts
    261
    Thank Post
    2
    Thanked 11 Times in 11 Posts
    Rep Power
    18

    Re: Shutdown batch script stalls if 1 PC is shut down

    I use the ASP version of this for my Wake On LAN portion of my ASP based management console.

  9. #9
    kearton's Avatar
    Join Date
    May 2007
    Location
    Yorkshire, via NZ ;)
    Posts
    887
    Thank Post
    175
    Thanked 113 Times in 91 Posts
    Rep Power
    48

    Re: Shutdown batch script stalls if 1 PC is shut down


SHARE:
+ Post New Thread

Similar Threads

  1. Server 2003 stalls after wsus update
    By pooley in forum Windows
    Replies: 2
    Last Post: 13th July 2007, 01:56 PM
  2. batch file to shutdown PCs
    By macca in forum Windows
    Replies: 5
    Last Post: 3rd May 2007, 09:20 AM
  3. Replies: 3
    Last Post: 23rd March 2007, 09:36 AM
  4. Replies: 18
    Last Post: 14th October 2005, 09:28 AM
  5. Script to shut down computers in a certain OU
    By tosca925 in forum Scripts
    Replies: 11
    Last Post: 25th September 2005, 09:23 PM

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
  •