Nishant Kutade
Nishant Kutade

Reputation: 11

Executing a jar file through batch script

I am trying to execute a .jar file(final output is a signature valid for few mins) through batch file.

Manual Steps in Jar

  1. Execute jar with java -jar command
  2. Input value1,value2,value3,value4,value5 (Interactive)
  3. Signature is generated.(Output)

Please refer below command prompt for clarity.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
C:\Users\611411820\Downloads>java -jar pas-signature-1.0.0.jar
Signature generation started
Enter key generate signature
userinput1
Enter the Value1 :
userinput2
Enter the Value2 :
userinput3
Enter the Value3 :
null
Enter the Value4 :
null
Signature generated is jLriqf5h8rVkDr9h+X7rVa2a7aRtd8xXzoYa7mv2JQs=
Signature generation ended

Requirement

  1. The batch file should read the userinputs(userinput1,userinput2,userinput3,null,null) from text file and paste the Signature generated in another text file.

  2. Requirement is to generated 2000 signatures.

Upvotes: 0

Views: 295

Answers (1)

Rishabh Dugar
Rishabh Dugar

Reputation: 616

Write your jar in a way that it accepts 2 parameters (input and output file).

open notepad type below

java -jar pas-signature-1.0.0.jar <input_file> <output_file>

Save your notepad as .bat

Run Your batch file

Upvotes: 0

Related Questions