这是我的代码:
@echo off
Setlocal EnableDelayedExpansion
set log=C:\mylog.log
set ftpFolder=C:\contributor\ftp
set rotterdamFolder=C:\rotterdam
cd /D C:\contributor
echo [FTP Folder: %ftpFolder%] >> %log%
cd /D %ftpFolder%
for /D %%f in (*) do (
cd %%f
for %%i in (*) do (
echo [FTP, %%f] Sending %%i >> %log%
for /f "tokens=1,2" %%a in (C:\input.txt) do (
if %%a==%%f (
set et=%%b
)
)
copy %ftpFolder%\%%f\%%i %rotterdamFolder%\%et% >> %log%
)
cd .. >> %log%
)
input.txt 文件类似于:
007 87855
008 87823
015 87830
如何划分两列(制表符或空格)并不重要。我的问题是 %et% 变量没有定义。这怎么可能?我需要使用变量“b”作为目标文件夹。错误在哪里?