批处理读取简单配置
配置文件config.txt
PATH_CODE=D:\code\
PATH_BIN=D:\tools\
读取配置批处理
@echo off
for /f "tokens=1,2 delims==" %%i in (config.txt) do (
set %%i=%%j
)
echo %PATH_CODE%\res
echo %PATH_BIN%\bin
rem or
set config_file=%~dp0\config.txt
::echo %config_file%
for /f "tokens=1,2 delims==" %%i in (%config_file%) do (
set %%i=%%j
)
echo %PATH_CODE%\res
echo %PATH_BIN%\bin
rem do something
pause