1 @echo off
2 setlocal enabledelayedexpansion
3 rem -----Batch File-----
4 for /f "tokens=1,2 " %%a in (list.txt) do (
5 set REMOTE_ADDR=%%a
6 echo !REMOTE_ADDR!
7 set PWD=%%b
8 echo !PWD!
9 set USER=administrator
10 echo !USER!
11 net use \\!REMOTE_ADDR!\IPC$ /u:!USER! "!PWD!"
12 copy D:\batch\ip.bat \\!REMOTE_ADDR!\Admin$\ /y
13 at \\!REMOTE_ADDR! 12:00 ip.bat
14 rem Admin$为系统根目录
15 )
DOS批量拷贝本地目录到远程主机(定时执行)
时间: 2024-10-27 17:07:06