Page 1 of 1

how to read name value pairs from command line

Posted: 25 May 2022 01:38
by batchnewbie
Dear all,


I want to read a number of name=value pairs from the command line, how do I read them and output to a file?

Code: Select all

C:\Users\myself\read_name_value_pairs.bat log_archive_dest_1="location=R:\app\oracle\oradata\londoncdb" db_name=londoncdb
output file temporary hardcoded to temp_pfile.ora

Code: Select all

db_name=londoncdb
log_archive_dest_1="location=R:\app\oracle\oradata\londoncdb" 

Re: how to read name value pairs from command line

Posted: 24 Sep 2022 03:51
by batmanbatmanbatmen

Code: Select all

@echo off

:loop
set np=
if "%~1" == "" goto :eof
set np=%1
shift
set np=%np%=%1
shift
echo %np%
goto :loop