Copy files to network computers on windows command line

前端 未结 3 1833
北恋
北恋 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 21:58

    Below command will work in command prompt:

    copy c:\folder\file.ext \\dest-machine\destfolder /Z /Y
    

    To Copy all files:

    copy c:\folder\*.* \\dest-machine\destfolder /Z /Y
    
    0 讨论(0)
  • 2021-02-01 22:08

    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.

    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题