Created
October 30, 2017 14:18
-
-
Save bhrgu/9c258cc26fab82560ae9a29548706eb6 to your computer and use it in GitHub Desktop.
Read key-value config file with good old cmd :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
SET CONFIGFILE=config.txt | |
REM Create the key-value config file | |
ECHO #Simple key-value config > %CONFIGFILE% | |
ECHO Key1=Value1 >> %CONFIGFILE% | |
ECHO Key2=Value2 >> %CONFIGFILE% | |
REM Read keys and setting values | |
FOR /F "eol=# delims== tokens=1,2" %%i IN (%CONFIGFILE%) DO SET %%i=%%j | |
REM Show varibales | |
SET Key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment