1.从文件中循环读ip
for /f %%i in (remote_hosts.txt) do (
)
remote_hosts.txt内容格式如下
xxxx.xxxx.xxxx.xxxx
xxxx.xxxx.xxxx.xxxx
2.远程连接使用net use 命令
参考链接:cmd xcopy 拷贝文件夹_cmd xcopy进行远程复制-优快云博客
3.远程拷贝使用 xcopy命令
参考链接:cmd xcopy 拷贝文件夹_cmd xcopy进行远程复制-优快云博客
4.远程脚本调用使用 wmic 命令
5.注意事项
远程调用的脚本中需要使用绝对路径,否则会执行失败。
密码中带%%
调试时注释脚本的rem @echo off