I have a property file with name 'props.txt' which has values like -
test=props
#test2=props
I have written a batch script to put these properties in Windows 10 environment variables as following:
#@ECHO OFF
For /F "tokens=1* delims==" %%A IN (props.txt) DO (
IF NOT "%A:~0,1%"=="#" (
SETX "%%A" "%%B"
)
)
Now all the properties are put into environment variables, even if they start with '#'. I want to ignore the properties which start with '#'. How can I do that? Also, I want to skip blank lines. Is there any change which I would need to do?