**如何读取配置文件里的内容呢?**
1. 首先,我们创建config.ini文件,内容如下:
![](https://box.kancloud.cn/7d05b28c6fa42f263ee35cb9c9fdbdea_1047x669.png)
2. 读取配置文件的内容
~~~
@echo off
setlocal enabledelayedexpansion
color 0A
title scedu batch copy and rename tool
echo %date% %time%
echo.
echo ==========================================
echo 赛诚智慧批处理管理人模文件夹
echo author:刘浩
echo version:1.0.0
echo date:2017-11-07
echo ===========================================
echo.
set root=%~dp0
set config_file=%root%config.ini
rem **从配置文件中读取内容**
for /f "tokens=1,2 delims==" %%i in (%config_file%) do (
echo %%i
echo %%j
echo.
)
pause
~~~
输出如下:
![](https://box.kancloud.cn/db4a8c36ffb78e3a45c976c2fa76eff8_672x278.png)