How can an exe get multiple input from batch scripting

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
idammanoj
Posts: 1
Joined: 27 Jun 2011 12:41

How can an exe get multiple input from batch scripting

#1 Post by idammanoj » 27 Jun 2011 13:27

Hi,

I am trying to automate the creation of self signed ssl certificate using openssl with following command.

Code: Select all

 openssl req -config openssl.cfg -new -out test.csr -keyout test.pem 


when I run this in command prompt it asks for various inputs like country name, state etc. My requirement is to send these values from a test file without asking the end user.

Please let me know if it is possible using batch script\vb script. Well I surely know we can do it with autoit but it would be my last option.

Thanks,
Manoj

PS: Never mind I found a solution with vbscript. Anyways it would be great if someone can come up with a batch script.

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

Re: How can an exe get multiple input from batch scripting

#2 Post by orange_batch » 28 Jun 2011 12:33

Code: Select all

for /f "delims=" %%x in (data.txt) do set "%%x"

data.txt:

Code: Select all

country=USA
name=John Smith
...

Code: Select all

echo Country is: %country%
echo Name is: %name%

Just feed the variables into your command after, however it works.

Post Reply