在 Windows 命令行上将文件复制到网络计算机 [英] Copy files to network computers on windows command line
本文介绍了在 Windows 命令行上将文件复制到网络计算机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在 Windows 上创建一个脚本,该脚本在管理员 PC 上运行时:
I am trying to create a script on Windows which when run on an admin PC:
- 通过指定IP地址/范围将一个文件夹从管理PC复制到一组网络PC中
- 对于每台目标 PC,导航到文件夹并运行另一个脚本文件.
Using the method described by seanyboy here:
net use \\{dest-machine}\{destfolder} {password} /user:{username}
copy {file} \\{dest-machine}\{destfolder}
我不确定如何编写for"循环来遍历每个dest-machine"并执行步骤 2.任何想法将不胜感激.
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.
推荐答案
检查 Robocopy:
check Robocopy:
ROBOCOPY \\server-source\c$\VMExports\ C:\VMExports\/E/COPY:DAT
确保检查您想要的 robocopy 参数.这只是一个例子.在 Windows 系统的命令行/powershell 中输入 robocopy/?
.
make sure you check what robocopy parameter you want. this is just an example.
type robocopy /?
in a comandline/powershell on your windows system.
这篇关于在 Windows 命令行上将文件复制到网络计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文