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