Is there a way to pass multiple param value pairs to a batch file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
batchnewbie
Posts: 7
Joined: 08 Nov 2021 19:35

Is there a way to pass multiple param value pairs to a batch file

#1 Post by batchnewbie » 27 Jan 2023 03:23

Dear all,

Is there a way to pass multiple param value pairs to a batch file, param_value.bat


db_domain="abc.com"
log_archive_dest_1="location=R:\app\oracle\oradata\examplecdb"

to param_value.bat ""db_domain="abc.com " log_archive_dest_1="location=R:\app\oracle\oradata\examplecdb" ""

batch file is supposed for write to empty file like abc.ora as follow:

Code: Select all

db_domain="abc.com"
log_archive_dest_1="location=R:\app\oracle\oradata\examplecdb"

many thanks in advance!

rodrigolima
Posts: 21
Joined: 19 Jul 2013 11:35
Location: Brazil

Re: Is there a way to pass multiple param value pairs to a batch file

#2 Post by rodrigolima » 29 Jan 2023 11:03

Hello batchnewbie,

It looks like a "ini file"... Look at "How to use ini files in batch files"

In my opinion, using a ini file you gotcha what you want to do!

That´s it! Have a fun with ini files!!!

:D 8) :D

gulshan212
Posts: 1
Joined: 18 Jan 2023 00:41
Location: Haldwani, Uttarakhand (India)
Contact:

Re: Is there a way to pass multiple param value pairs to a batch file

#3 Post by gulshan212 » 13 Feb 2023 09:00

Hello this is Gulshan Negi
Yes, there are several ways to pass multiple parameter value pairs to a batch file in Windows. One common method is to use command-line arguments. For example, if you have a batch file named "example.bat" and you want to pass two parameter value pairs to it, "param1=value1" and "param2=value2", you can run the following command:
example.bat param1=value1 param2=value2
Thanks

Sponge Belly
Posts: 231
Joined: 01 Oct 2012 13:32
Location: Ireland
Contact:

Re: Is there a way to pass multiple param value pairs to a batch file

#4 Post by Sponge Belly » 20 Feb 2023 11:51

Hi Batch Newbie! :)

Please read dbenham’s answer to this Stack Overflow
Question
.

HTH!

- SB

Post Reply