10
以下代碼未更新即使匹配發生,但仍運行爲等於N.這意味着我不會掉入CALL代碼。我在這裏錯過了什麼嗎?批處理文件無法在IF子句中設置變量
SET Run=Y
REM Check current files date/time information and establish if the file has been present too long in the directory
REM Skip first 4 lines as header information not required
FOR /f "tokens=1-5 skip=4 delims= " %%G IN ('dir /OD "%SRCH_CRITERIA% "') DO (
ECHO "Params to processFile: " %%G %%H %%I ""%%K""
IF %%K.==. (
ECHO "K:nothing"
SET Run=N
ECHO %Run%
)
IF %%K==free (
ECHO "K:FREE"
SET Run=N
ECHO %Run%
)
ECHO %Run% RUN
IF %Run%=="Y" (
CALL :processFile "%%G" "%%H" "%%I" "%%K"
)
)
謝謝paxdiablo,完全排序我的問題 – sapatos 2009-12-30 05:08:07