Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

need to push(deploy) few batch files to the machines on a network. All nodes are running Windows. The batch files contain some commands to initialize an env on each node.

what ways can this be accomplished? any tools readily available? thanks in adv.

share|improve this question
So you want to just copy the files to the computers? What's wrong with a quick batch/PS file to copy them? – Chris S Mar 16 '11 at 12:48
just to copy the files to multiple nodes on network and launch the batch files automatically – John-ZFS Mar 16 '11 at 14:45
up vote 2 down vote accepted
  1. Create list of computers in a file (not exactly necessary, but usually the easiest), named computer.list (or whatever):

  2. Run batch file:

    for %%i in (computer.list) do copy file_to_push.ext \\%%i\c$
    for %%i in (computer.list) do psexec \\%%i C:\file_to_push.ext

    (Fixed this part, cp isn't right, should be copy)
    Link to download psexec if you don't have it already.

    Same thing in PS:

    foreach ($wsn in Get-Content Computer.List)
        cp file_to_push.ext \\$wsn\c$
        psexec \\$wsn C:\file_to_push.ext
share|improve this answer
should these hostnames resolve to IPs? – John-ZFS Mar 16 '11 at 17:23
@John, yes the names must resolve via NetBIOS or DNS; unless you're using NetBEUI. – Chris S Mar 16 '11 at 19:27
the above code is not working "syntax error in for loop"...I am not good in MS DOS batch...could you help pls? any equivalent in powershell? – John-ZFS Mar 17 '11 at 14:19
@John - I updated the batch script with the correct %%i syntax. The %i would only work when typed from a command line. – Doug Luxem Mar 17 '11 at 17:33
@Doug, thank you, been too long since I used batch files apparently. – Chris S Mar 17 '11 at 17:42

Your Answer


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.