lundi 4 avril 2016

Batch If and Else Error

I have looked through a few of the questions on here and I was unable to find what I was looking for. Hopefully I can get some clarification on this.. I have the following Batch Code Block:

:CommandCheck
If Exist java -version (goto start)Else
(echo !!Java not installed!! Installing supported version now)
goto install

But when I run this, it just closes the command prompt. I am trying to get it to test a certain command and if it fails to load, it goes to another part of the script and if it does exist, it goes elsewhere. I have tested various methods mentioned here and else where but I cannot seem to get the working formula.

Aucun commentaire:

Enregistrer un commentaire