Page 1 of 1

How can an exe get multiple input from batch scripting

Posted: 27 Jun 2011 13:27
by idammanoj
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.

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

Posted: 28 Jun 2011 12:33
by orange_batch

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.