+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
Windows Server 2008 R2 Thread, Command Prompt / Scripts / Shutdown.exe lag in Technical; Has anybody ever experienced an issue with running .bat files on Server 2008 R2 where they seem to run at ...
  1. #1
    Nick_Parker's Avatar
    Join Date
    Jan 2008
    Location
    Dainfern, South Africa
    Posts
    437
    Thank Post
    95
    Thanked 18 Times in 13 Posts
    Rep Power
    17

    Command Prompt / Scripts / Shutdown.exe lag

    Has anybody ever experienced an issue with running .bat files on Server 2008 R2 where they seem to run at an absolute crawl?
    I have 4 batch files which I use to shutdown/restart the labs and sometimes when I run them they seem to run at a snails pace taking up to 10 minutes to complete.
    In the attached screenshot you can see I am attempting to restart 3 of the labs and the scripts have been running for nearly 10 minutes so far?
    Command Prompt Lag.jpg

  2. #2


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,691
    Thank Post
    352
    Thanked 796 Times in 715 Posts
    Rep Power
    347
    I wouldn't do it like that, I'd fork each shutdown/restart process into it's own process so they run almost in parallel instead of sequential.

    Try adding "start" at the front of each of your commands to see if that helps.

  3. #3
    Nick_Parker's Avatar
    Join Date
    Jan 2008
    Location
    Dainfern, South Africa
    Posts
    437
    Thank Post
    95
    Thanked 18 Times in 13 Posts
    Rep Power
    17
    Thanks @kmount, I'll give it a try!

    Just an update - The scripts took nearly 40 minutes to run and shutdown 100 PCs.

  4. #4


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,691
    Thank Post
    352
    Thanked 796 Times in 715 Posts
    Rep Power
    347
    Quote Originally Posted by Nick_Parker View Post
    Thanks @kmount, I'll give it a try!

    Just an update - The scripts took nearly 40 minutes to run and shutdown 100 PCs.
    That's a long old time, I suspect it is because it's connecting to each one in turn and sending it a hello, please shutdown whereas I'm suggesting it goes and asks 100 of them simultaneously to do it so each conversation can take as long as it wants because there's 100 going on at once.

    (maybe 100 is too many but you'll find a figure that fits)

  5. #5
    RobBaxter's Avatar
    Join Date
    Jun 2011
    Location
    Baldock
    Posts
    93
    Thank Post
    8
    Thanked 21 Times in 15 Posts
    Blog Entries
    1
    Rep Power
    10
    I know i sound like a advert bot, however, Impero is a GOD SEND for this kinda stuff. Just saying

  6. Thanks to RobBaxter from:

    russdev (18th October 2013)

  7. #6
    Nick_Parker's Avatar
    Join Date
    Jan 2008
    Location
    Dainfern, South Africa
    Posts
    437
    Thank Post
    95
    Thanked 18 Times in 13 Posts
    Rep Power
    17
    I gave the START thing a try, it did seem to execute much quicker, however, it's still causing an issue somewhere because I tried to open a command prompt window straight after running it and it took 2 minutes before I actually had a prompt. I then typed a ping command and it sat for a minute before it resolved and actually sent the ping.

  8. #7
    Nick_Parker's Avatar
    Join Date
    Jan 2008
    Location
    Dainfern, South Africa
    Posts
    437
    Thank Post
    95
    Thanked 18 Times in 13 Posts
    Rep Power
    17
    Quote Originally Posted by RobBaxter View Post
    I know i sound like a advert bot, however, Impero is a GOD SEND for this kinda stuff. Just saying
    I shall have a look see

  9. Thanks to Nick_Parker from:

    russdev (18th October 2013)

  10. #8


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,691
    Thank Post
    352
    Thanked 796 Times in 715 Posts
    Rep Power
    347
    Quote Originally Posted by Nick_Parker View Post
    I gave the START thing a try, it did seem to execute much quicker, however, it's still causing an issue somewhere because I tried to open a command prompt window straight after running it and it took 2 minutes before I actually had a prompt. I then typed a ping command and it sat for a minute before it resolved and actually sent the ping.
    Ah yes, it is probably battering your server to do these naughty things.

    You may find running it in batches of 10 is nicer to it, maybe like:

    START yadda machine1
    START yadda machine2
    START yadda machine3
    START yadda machine4
    START yadda machine5
    (all of the way to 10)

    SLEEP 30 (so it stops doing stuff for 30 seconds to let the above run through)

    START yadda machine11

    etc.

  11. #9

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,763
    Thank Post
    3,273
    Thanked 1,053 Times in 974 Posts
    Rep Power
    365
    Not sure how much difference this would make but I presume you are running the command prompt with elevated access rights ie run as admin?

  12. #10
    Duke5A's Avatar
    Join Date
    Jul 2010
    Posts
    805
    Thank Post
    82
    Thanked 132 Times in 115 Posts
    Blog Entries
    8
    Rep Power
    32
    You should be using psexec for this; it's part of the Sysinternals Utilities suite and is a free download through Microsoft.

    Sysinternals Utilities

    Drop each computer name in a text file on its own line and run it some like this:

    Code:
    psexec @PCList.txt -d "shutdown -r t 0"
    It'll start the shutdown process client side all at the same time. You may need to play around with command switches to tweak it, but I use this utility all the time to refresh group policy en mass amongst other things.

    BTW - are the clients XP?
    Last edited by Duke5A; 16th October 2013 at 08:55 PM.

  13. Thanks to Duke5A from:

    mac_shinobi (16th October 2013)

  14. #11
    DMcCoy's Avatar
    Join Date
    Oct 2005
    Location
    Isle of Wight
    Posts
    3,456
    Thank Post
    10
    Thanked 494 Times in 434 Posts
    Rep Power
    112
    It's just waiting for a dns/rpc timeout, around 30 seconds for each computer that isn't resolvable/responding. If they were all *on* and dns is working/scavenged then it wouldn't take long. As everyone else has said, best to run the commands in parallel if you want it quick. Although the time taken doesn't actually mean anything is broken

  15. #12
    free780's Avatar
    Join Date
    Sep 2012
    Posts
    979
    Thank Post
    42
    Thanked 82 Times in 78 Posts
    Rep Power
    21
    Could just deploy a scheduled tssk to shut them down.

  16. #13
    Nick_Parker's Avatar
    Join Date
    Jan 2008
    Location
    Dainfern, South Africa
    Posts
    437
    Thank Post
    95
    Thanked 18 Times in 13 Posts
    Rep Power
    17
    Quote Originally Posted by mac_shinobi View Post
    Not sure how much difference this would make but I presume you are running the command prompt with elevated access rights ie run as admin?
    Yep, being run as Administrator

  17. #14
    Nick_Parker's Avatar
    Join Date
    Jan 2008
    Location
    Dainfern, South Africa
    Posts
    437
    Thank Post
    95
    Thanked 18 Times in 13 Posts
    Rep Power
    17
    Quote Originally Posted by DMcCoy View Post
    It's just waiting for a dns/rpc timeout, around 30 seconds for each computer that isn't resolvable/responding. If they were all *on* and dns is working/scavenged then it wouldn't take long. As everyone else has said, best to run the commands in parallel if you want it quick. Although the time taken doesn't actually mean anything is broken
    Trying out the START command now

  18. #15
    Nick_Parker's Avatar
    Join Date
    Jan 2008
    Location
    Dainfern, South Africa
    Posts
    437
    Thank Post
    95
    Thanked 18 Times in 13 Posts
    Rep Power
    17
    Quote Originally Posted by Duke5A View Post
    You should be using psexec for this; it's part of the Sysinternals Utilities suite and is a free download through Microsoft.

    Sysinternals Utilities

    Drop each computer name in a text file on its own line and run it some like this:

    Code:
    psexec @PCList.txt -d "shutdown -r t 0"
    It'll start the shutdown process client side all at the same time. You may need to play around with command switches to tweak it, but I use this utility all the time to refresh group policy en mass amongst other things.

    BTW - are the clients XP?
    Thanks @Duke5A, I'll give it a try And no, they're all Windows 7
    Last edited by Nick_Parker; 17th October 2013 at 03:09 PM. Reason: Forgot some info.

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Scripting an Elevated Command Prompt?
    By Garacesh in forum Scripts
    Replies: 11
    Last Post: 13th February 2013, 03:41 PM
  2. Blocking Command Prompt with Group Policy
    By sebbywebby in forum Windows 7
    Replies: 8
    Last Post: 6th December 2010, 02:32 PM
  3. Copying Command prompt to clipboard
    By russdev in forum Windows
    Replies: 10
    Last Post: 21st April 2009, 07:39 AM
  4. Uploading to sharepoint document library via command prompt?
    By BatchFile in forum Virtual Learning Platforms
    Replies: 1
    Last Post: 27th January 2009, 11:13 AM
  5. Prevent Student Access To Command Prompt
    By DaveP in forum How do you do....it?
    Replies: 13
    Last Post: 21st March 2007, 11:37 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
  •