Thursday, April 25, 2013

Batch File to Send a File to All Computers in Network

Sending a single file to all computers in the network is quite a common task for Windows system administrators. It is handy to have a script that will automate this process. Here is the batch file to send a file to all computers in network:
REM Mass File Sender
REM Sends the specified file to all computers
REM in your network. 


REM Don't forget to replace "compyfile" before
REM executing this script.
SET copyfile=SomeFile.ext
net use S: /delete /y
@net view  | @FOR /F "tokens=1" %%c in ('@find "\\" ') do (
net use S: %%c\c$\bin
COPY %copyfile% S:\ /y
net use S: /delete /y
)

You should just change 'copyfile' to the path to the needful file before executing this script. You should also remember that sending large files can make your network very slow.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

No comments:

Post a Comment

Translate