复制代码
- @echo off
- REM 读取 a.txt 第三行
- call :FileReadLine str "a.txt" 3
- echo "%str%"
- pause & exit /b
- :FileReadLine <OutputVar> <Filename> <LineNum>
- (for /l %%i in (1 1 %~3) do set "%~1=" & set /p "%~1=") < %2
- exit /b
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |