Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Automating -createPasswordFile in Windows

 I'm currently trying to automate the set up of JBEs on Windows environments. I'm at the point of creating the password file using:

jbe.bat -createPasswordFile

Which launches a Java process requesting user input. I would like to know if it's possible to redirect input to the process which is launched, auto-completing the request for a password. For reference purposes our solution in Linux is:

echo "${jazz_password}" | ./jbe.sh createPasswordFile

1 vote


Accepted answer

Permanent link
Your problem is related more to Windows batch file restrictions than the command itself.  By running the JBE launcher jar directly I was able to get this to work:
	C:\tmp\IBM\jbe>set JAVA_HOME=C:\IBM\Rational\RTC\RTC-Eclipse\4.0.6\jazz\client\eclipse\jdk
	C:\tmp\IBM\jbe>echo secret | %JAVA_HOME%\jre\bin\java -jar C:\IBM\Rational\RTC\toolkits\4.0.6\buildtoolkit\jazz\buildsystem\buildengine\eclipse\plugins\org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar -createPasswordFile tom


	*** Warning: password will be printed to the screen. 
        password:

	Password stored in file: "C:\tmp\IBM\jbe\tom"

	*** Warning: The password is encrypted to prevent casual observation, but a determined attacker may discover the password. The password file should be protected with operating system file permissions.

This yielded the following password file (* substituted for ? and ! due to editor restrictions):
	C:\tmp\IBM\jbe>type tom
	<*xml version="1.0" encoding="UTF-8"*>
	<*DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
	<properties>
	<comment>4.0</comment>
	<entry key="password">TW6nCXFrd+4=</entry>
	</properties>
Michael Shaffer selected this answer as the correct answer

1 vote

Comments

FYI you can further refine this to prevent any output to the console by redirecting the output to the nul device:

C:\tmp\IBM\jbe>echo secret | %JAVA_HOME%\java -jar C:\IBM\Rational\RTC\toolkits\4.0.6\buildtoolkit\jazz\buildsystem\buildengine\eclipse\plugins\org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar -createPasswordFile tom > nul 2>&1

 Alan, thanks for the quick and concise response, I really appreciate it!

1 vote

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,953
× 87
× 76

Question asked: Nov 21 '14, 11:38 a.m.

Question was seen: 3,550 times

Last updated: Mar 19 '15, 9:39 a.m.

Confirmation Cancel Confirm