1
我試圖創建下面的批處理文件:循環在Windows批處理文件
@echo off
set "list=AICourse AIStudent Teacher"
set Server="localhost"
set Username="user"
set Password="()[email protected]"
for %%n in (%list%) do (
Set File=c:\temp\%%n.bcp
Set Log=c:\temp\%%n.log_exp
ECHO Begin BCP...: %TIME%
ECHO waiting...
bcp Database.dbo.%%n OUT %File% -o %Log% -S%Server% -U%Username% -P%Password% -c
ECHO End BCP..: %TIME%
ECHO Log in file %Log%
)
然而,當我試圖通過數組進行迭代,只返回最後的結果。我如何迭代呢?
添加標記%File%需要修改爲!文件!太。謝謝。 –
哎呀,我錯過了那一個......添加到答案。 – aphoria