- @echo off
- setlocal EnableDelayedExpansion
- cd /d "%~dp0"
- @REM set rar="C:\Program Files\WinRAR\WinRAR.exe"
- set rar="rar.exe"
- set files="2.txt" "cd.txt" "stdout.txt" "stderr.txt"
- set comh="include\com.h"
- 2>nul md user_rar
- for %%A in (%files%) do (
- set "t=%%~tA"
- set "t=!t:-=!"
- set "t=!t:/=!"
- set "t=!t::=!"
- set "t=!t: =_!"
- goto break
- )
- :break
- set stack=0
- for /f "usebackq tokens=1*" %%A in (%comh%) do (
- if "!stack!"=="0" (
- if /i "%%B"=="(CUSTOMER_BOARD_TYPE == CUSTOMER_ZY_SP10)" set stack=1
- ) else if "!stack!"=="1" (
- for /f "tokens=1*" %%C in ("%%B") do (
- if "%%C"=="VERSION_NUMBER" (
- set "vn=%%~D"
- goto break2
- )
- )
- )
- )
- :break2
- echo vn=[!vn!]
- %rar% a "user_rar\DSFC_DSNB_!vn!_!t!.rar" %files%
- endlocal
- pause
复制代码 回复 15# oyr520 |