0

I am trying to run following sequence of commands in a batch file.

C:\"Program Files"\Java\jdk1.8.0_25\bin\jarsigner.exe -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore .\my-release-key.keystore .\platforms\android\build\outputs\a
pk\android-release-unsigned.apk alias_name

set /p ver="Enter Version:" 

G:\"Android Studio"\sdk\build-tools\23.0.1\zipalign.ex
e -v 4 ".\platforms\android\build\outputs\apk\android-release-unsigned.apk" AppName%ver%.apk

However, the command terminates and does not accept complete URL in the first command, check screenshot.

Command Terminated

What am I doing wrong? Any suggestions or solutions are highly appreciated.

Community
  • 1
  • 1
Samarth Agarwal
  • 2,044
  • 8
  • 39
  • 79
  • 2
    You have a line feed -> new line in there, it seems. Look how he cuts the program after the a and interpretes the rest of it as a new command? Same goes for the last two lines in your example above. – geisterfurz007 Jan 04 '17 at 12:28
  • 2
    I'd say that you need to use a proper text-editor like `editplus` or `motepad++` (amongst others). Whatever editor you are using seems to be playing games, as has been observed. – Magoo Jan 04 '17 at 12:31
  • Editing in VS Code worked. There was a line break after `a`. Thanks. – Samarth Agarwal Jan 04 '17 at 12:59
  • See [How to set environment variables with spaces?](http://stackoverflow.com/questions/34353504/how-to-set-environment-variables-with-spaces) It explains not just for environment variables how to use double quotes in general around file/folder names and other parameter strings. – Mofi Jan 04 '17 at 16:32
  • Thanks. I now enclose whole path in quotation marks. – Samarth Agarwal Jan 04 '17 at 18:15

0 Answers0