Copy files to network computers on windows command line

前端 未结 3 1839
北恋
北恋 2021-02-01 21:52

I am trying to create a script on Windows which when run on an admin PC:

  1. Copies a folder from the admin PC into a group of network PCs by specifying the ip address
3条回答
  •  遇见更好的自我
    2021-02-01 22:09

    Why for? What do you want to iterate? Try this.

    call :cpy pc-name-1
    call :cpy pc-name-2
    ...
    
    :cpy
    net use \\%1\{destfolder} {password} /user:{username}
    copy {file} \\%1\{destfolder}
    goto :EOF
    

提交回复
热议问题