I have two files.
values.properties
user=username
password=Password1234!
mybatch.bat
SETLOCAL EnableDelayedExpansion
For /F "tokens=1,2 delims==" %%A IN (path/values.properties) DO (
IF "%%A"=="user" set user=%%B
IF "%%A"=="password" set password=%%B
)
In the batch file, password's value is:
Password1234
So basically, the "!" disappear. I want to make "password" store any value, no matter what special characters will contain. How can I do this? I tried to escape the "!" be adding "password=^^%%B". Did not work.
Thank you.