Copy files to network computers on windows command line

networking, scripting, windows

Solution

check Robocopy:

`ROBOCOPY \\server-source\c$\VMExports\ C:\VMExports\ /E /COPY:DAT`

make sure you check what robocopy parameter you want. this is just an example. type `robocopy /?` in a comandline/powershell on your windows system.

Problem

I am trying to create a script on Windows which when run on an admin PC: - Copies a folder from the admin PC into a group of network PCs by specifying the ip address / range - For each destination PC, Navigate into the folder and run another script file. Using the method described by seanyboy here: ``` net use \\{dest-machine}\{destfolder} {password} /user:{username} copy {file} \\{dest-machine}\{destfolder} ``` I'm not sure on how i can write a 'for' loop to go through each 'dest-machine' and perform step 2. Any ideas would be greatly appreciated.

Original source

Related problems