I am writing a batch file that will generate/write to a property file based on multiple user input values. However, it is not recording the values of input. The result looks like
prop1=
prop2=
I wonder if there's something I need to know with set that is preventing this from working.
Weird part is that if I run this particular script multiple times, the value output from echo seems to be always be the user input from last time.
Code:
@echo off
IF NOT EXIST data_file (
set /p prop1=Enter value:
set /p prop2=Enter value:
(echo prop1=%prop1%) > data_file
(echo prop2=%prop2%) >> data_file
)