Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted
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)

Posted
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.
Posted
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.

Posted (edited)

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:

 

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?

Edited by Duke5A
  • Thanks 1
Posted
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
Posted
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 :)

Posted
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 :)

Posted (edited)
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:

 

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 :D And no, they're all Windows 7

Edited by Nick_Parker
Forgot some info.
Posted
@Michael Just curious if powdamonkey or whatever his eg handle is continued with shutdownertron ??

 

It still exists here, however I see no need seeing as it can all be achieved with GPP (as I descried above).

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...