0

For various reasons, I want to make a batch script that can launch keytool.exe from either JRE or JDK. I thought this would be rather simple, but it has proven to be rather difficult. Here are some of the methods I have used, but none of which work:

"keytool.exe"

cd "keytool.exe"

start "keytool.exe"

"C:\Program Files (x86)\Java\jre1.8.0_141\bin\keytool.exe"

"Program Files (x86)\Java\jre1.8.0_141\bin\keytool.exe"

".\Program Files (x86)\Java\jre1.8.0_141\bin\keytool.exe"

%SYSTEMROOT%\Windows\System32\cmd.exe "C:\Program Files (x86)\Java\jre1.8.0_141\bin\keytool.exe"

(Note: Based on the scripts content is where I placed it, I am aware of how to properly place the script accordingly...)

There are several others I used, but to avoid clutter I did not list them. I'm pretty stumped on why this isn't working, I have made many many batch script launchers for a wide array of programs. Is this possible? Even creating a shortcut does nothing. I assumed the shortcut wouldn't work but thought it was worth a shot anyways.

7
  • Just with above commands it will run and exit. You need to provide command line parameters for it to do anything
    – AEonAX
    Commented Jul 31, 2017 at 7:06
  • How so? I know that I can run it by opening cmd and typing "C:\Program Files (x86)\Java\jre1.8.0_141\bin\keytool.exe". Why (and how) do I use command-line parameters to run it through scripting? Commented Jul 31, 2017 at 7:08
  • what do you want to do by opening keytool?
    – AEonAX
    Commented Jul 31, 2017 at 7:09
  • I just want to run it so that I can make JKS, keyes, and certificates to sign APKs and JARs . Commented Jul 31, 2017 at 7:10
  • 1
    Aaah, now I see what you mean by parameters, I was under the impression that I ran it, then provided arguments and functions. (Obviously) I am still fairly new to keytool. I'll just tinker with it for now... Commented Jul 31, 2017 at 7:15

0

You must log in to answer this question.

Browse other questions tagged .