I have con.properties file as below.
data1=users
data2=admins
When a user clicks on batch file provided, values of the above have to be changed based on the area.
if user selected country1 con.properties file has to be changed as below
data1=hello
data2=bye
if user selected country2 con.properties file has to be changed as below
data1=users
data2=admins
I have tried this:
@ECHO OFF
SET /P area="Choose a country (type Country1, Country2): "
2>NUL CALL :%area% # jump to :Country1, :Country2, :England, etc.
IF ERRORLEVEL 1 CALL :DEFAULT_CASE # If label doesn't exist
ECHO Done.
EXIT /B
:Country1
powershell -Command "& {(Get-Content "con.properties") -replace 'users','hello' | Out-File -FilePath con.properties;}"
GOTO END_CASE
:Country2
powershell -Command "& {(Get-Content "con.properties") -replace 'users','bye' | Out-File -FilePath con.properties;}"
GOTO END_CASE
:DEFAULT_CASE
ECHO Wrong Case
GOTO END_CASE
:END_CASE
VER > NUL # reset ERRORLEVEL
GOTO :EOF # return from CALL
Above script replacing values mentioned in the argument but it has to replace the values based the data1 and data2