
【已解決】這段批處理代碼為什么不正確最后由 chouxia 于 -10-28 08:17
執行的時候提示我語法不正確if not exist v:!inipath!work_%i.avi而且 echo NO.0 !num!!inipath!!dataname!這行根本沒顯示變量!num!為何沒有數據?執行到echo NO.0 !num!!inipath!!dataname!截止既:后面的forindo 都不在的話輸出內容如下:NO. 0 5 1temp1007183419010016h 1007183419010016hNO. 0 5 1temp1007183419010016s 1007183419010016sNO. 0 5 1temp1007183419060016h 1007183419060016hNO. 0 5 1temp1007183419060016s 1007183419060016snclick="copycode($('code0'));">復制代碼
- @echo on
- setlocal enabledelayedexpansion
- set num=0
- set inipath=0
- set dataname=0
- cd v:1data
- for /f %%z in ('findstr /s /i /m data=1 *.txt') do (
- for /f tokens=1,* delims==%%a in ('find num ^< %%z') do ( set num=%%b )
- for /f tokens=1,* delims==%%c in ('find inipath ^< %%z') do ( set inipath=%%d )
- for /f tokens=1,* delims==%%g in ('find dataname ^< %%z') do ( set dataname=%%h )
- echo NO.0!num!!inipath! !dataname!
- for /l %%i in (1,1,!num!) do (
- if not exist v:!inipath!work_%%i.avi
- echo ok
- if exist v:!inipath!work_%%i.avi
- echo n-----ok
- )
- )

