用批处理文件读取简单的配置文件

Let's say, configuration list in config.ini is as:

abc=abc

a=a

localpath=D:\local\path

 To read the key-value, we create a test.bat:

@echo off

setlocal enabledelayedexpansion

for /f "delims=" %%i in ('type "config.ini"^| find /i "="') do set %%i

echo %a%

echo %abc%

echo %localpath%

Drop config.ini and test.bat to the same folder then run test.bat from command prompt you'll see the result.

 

你可能感兴趣的:(配置文件)