Skip to content

Instantly share code, notes, and snippets.

@nerflad
Created July 2, 2016 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nerflad/f933194f798ffdc481f535d1d76e1fd0 to your computer and use it in GitHub Desktop.
Save nerflad/f933194f798ffdc481f535d1d76e1fd0 to your computer and use it in GitHub Desktop.
Read all .cfg files in cwd with nested FOR loop
@echo off
:readCfgs
for %%A in (%~dp0*.cfg) do (
for /f %%B in (%%A) do (
set "varName=%%~nA"
set "!varName!="
set "!varName!=%%B"
)
)
goto :EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment