本帖最后由 pcl_test 于 2017-3-29 20:58 编辑
- @echo off&setlocal enabledelayedexpansion
- for /f "tokens=2 delims==" %%i in ('more +7 "%~f0"') do (
- set /a n+=1
- if !n!==3 call set v3=%%i
- )
- echo %v3%
- pause&exit
- 1.a=1
- 2.b=2
- 3.c=%date:~0,4%
复制代码 又或者- @echo off
- for /f "delims=" %%i in ('findstr "^3\." "%~f0"') do call set #%%i
- echo.%#3.c%
- pause&exit
- 1.a=1
- 2.b=2
- 3.c=%date:~0,4%
复制代码
|