lundi 8 mai 2017

Filtering for multiple results in batch using IF

I was writing a batch file replicating CMD but more customized. What I am trying to do is scan %input% for multiple different results leading to different actions. To help you envision what I mean, I tried doing this:

set /p input="%cd%>"

if "%input%" == "cls" (

GOTO reset

) else (

if "%input%" == freespace (

GOTO freespace

) else ( title %input%

%input%

GOTO A

Which just crashes the CMD window running the batch file. Is there anyway I can sort for these two responses (or possibly more) using IF statements? I realize this is SIMILAR to other questions called "using multiple if statements in batch" but they are just not the same format I am trying to put the IF statements in.

Aucun commentaire:

Enregistrer un commentaire