Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a .bat file to perform maintenance on machines. I put the .bat file on a network attached server for all workstations to access it.

If I were to use the windows scheduler to make that .bat file run at 12:00:00.000 on say... 50 workstations, will they all be able to run it or will it error out?

P.S. don't ask me to try it =P

share|improve this question

migrated from superuser.com Aug 29 '11 at 22:07

This question came from our site for computer enthusiasts and power users.

2  
There shouldn't be any issues with doing this as it is a fairly common practice in windows environments. The only possible issue you might face with 50 workstations running the file at once is bandwidth on the network, though this depends solely on what exactly the batch file does - most likely it will not be a problem. –  MaQleod Aug 29 '11 at 17:21
5  
Try it and see :p –  Sandeep Bansal Aug 29 '11 at 17:42
    
@MaQleod The bat file itself is only 1kb large. However, it runs a defrag check, and if the workstation is due for a defragmentation, the script waits for the defrag to finish before moving onto the next command. Do you believe that the workstation is actively attached to that .bat file on the server or if it is temporarily imported locally when accessed? –  Mechaflash Aug 29 '11 at 18:27
    
Note that the task scheduler has a feature to vary the start times of a scheduled job, precisely so that 50 machines don't go off perfectly synchronized. It's in Win7 but not in Win2K; I don't know when it was introduced. If your setup causes you trouble, that is one possible way to mitigate it. –  RBerteig Aug 29 '11 at 18:54
2  
My network utilizes a deployment application for managing ~4K workstations. There is a single server which acts as a repository for our scripts and software. I have scheduled jobs to run on 1000s of workstations simultaneously. If your infrastructure is up to it, everything will be fine. Considering it's a simple text batch file, I can't imagine it would be a problem. –  jscott Aug 29 '11 at 22:17

6 Answers 6

up vote 10 down vote accepted

This should work so long as the account you run the scheduled task using has correct access to the network share where the bat file is located.

Depending on what the script does, I'd stagger the run times by department. You only need a minute or two of variance to minimize the odds of a staggering hit right at 12. Regarding the commenter above who mentions a login script that high numbers of machines hit, computer logins do not occur at exactly the same moment. Even a few second difference between logins will result in different times for the script getting accessed, so his case, while close, is not exactly the same as yours regarding high levels of simultaneous file access.

share|improve this answer
    
Yup I've been test-deploying the script on a few workstations and it works fine. However, I have not run them at the same time yet and I was curious on whether or not I would run into a snag if all of them ran the one script at the same exact time. Don't want to come into the office the next morning with all of the workstations having an error screen and my non-technical boss freaking out about it lol –  Mechaflash Aug 29 '11 at 18:26
    
With 50 workstations I don't think it is too likely the server will be crippled or individual workstations would have trouble. But for two reasons it would be better to do it "properly" from the beginning: You won't have to change anything if you upgrade or expand, and it's better to be safe than sorry. With that few workstations, it wouldn't be too hard to spread the runtimes out into 5 groups that each process one minute after the previous group starts, or 2 groups, whichever works. –  music2myear Aug 29 '11 at 19:02
1  
Yeah. My original thoughts were to space it out into half hour intervals and each department would get their own day of the month for maintenance to help mitigate any issues that may occur from the maintenance. –  Mechaflash Aug 29 '11 at 19:09

Having batch file will work but consider limitations such as having appropriate permission and admin requirements.

You may consider deploying it as Logon Script thru Active Directory.

share|improve this answer

Why would you imagine it might error out? Each workstation simply reads the file and executes its commands. Provided your server is real server and not just a workstation pretending to be a server there will be no issue.

The only thing you need to keep in mind is that a batch file is read and executed one command at a time. Therefore, if you were to make a change to that file while it was being executed the behaviour can be somewhat unpredictable. The actual results would depend on what has changed and exactly where in the file the client is at that time.

share|improve this answer

I believe it works fine. But reality is better so let me say we use a .cmd file as our logon script. It is centrally hosted on a server and accessed by 6-800 PCs every morning during login. We've never seen an issue with multiple accesses to the script at once.

share|improve this answer
    
what if you were to have all machines booted, and sent a run command to all 800 PCs to access that script at once? XD That's the question –  Mechaflash Aug 29 '11 at 18:24
    
This should work anyway. As long as you don't write to the file 800 machines can read it. –  MadBoy Aug 29 '11 at 19:36
    
Mechaflash - my point was that we have a lot of workstations doing this everyday. Scheduled or not, many hit the file all at once without incident. –  uSlackr Aug 29 '11 at 21:11

I would expect the answer to be yes.

The company I work at has a batch file that runs from a network fileshare that runs as every machine starts up. If there were any problems of the type you expect in your question then the batch file would fail reasonably regularly but as far as I am aware it works every time.

share|improve this answer
    
Same with us. However each machine doesn't boot at the same exact millisecond in time. And even if they booted at the same time, each computer loads at different speeds so it wouldn't matter. This batch file runs in the middle of the night while all machines are already booted up and on a ctrl+alt+dlt login screen. –  Mechaflash Aug 29 '11 at 18:22
    
Good point, though in our case some of the machines operate over slow VPN links, which could potentially "lock" the batch file for extended periods (of the order of tens of seconds), this does not appear to be a problem though. –  Mokubai Aug 29 '11 at 18:24
    
Files should only get locked if they are opened for editing. In the case of running a batch file, it is not locked when the workstations only read or run it. –  KJ-SRS Aug 29 '11 at 22:24

One possible reason this might not work is if your server isn't licensed for 50 simultaneous connections. This is unlikely to be a problem in any real deployment, but if the "server" is, say, a Windows XP box or something you will have problems. If you have an actual server edition of Windows and enough CALs I see no reason why having 50 clients read a single batch file simultaneously would be a problem in and of itself.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.