将.ini中的某些文本复制到.bat

时间:2013-06-09 06:06:51

标签: batch-file

例如,我提供了 ID.ini Setup.bat

我想从"C:\Program Files\myapp"中复制此行"ID.ini" Install Directory="C:\Program Files\myapp"

我想将行"C:\Program Files\myapp"粘贴到.bat

@echo off
echo Install Directory= (paste it here!)

1 个答案:

答案 0 :(得分:1)

试试这个:

for /f "tokens=1,*delims==" %%i in (id.ini) do if /i "%%i"=="Install Directory" echo(%%j