jeudi 12 décembre 2019

How to write IF and ELSE in batch file

@ECHO OFF
SETLOCAL EnableDelayedExpansion


SET /P tool=Please enter the tool name: 

If %tool%=="fw-test.exe" (echo "The tool name is fw-test.exe") else (echo "Unknown tool name") 

If %tool%=="ick-test.exe" (echo "The tool name is ick-test.exe") else (echo "Unknown tool name")

I get a syntax error. How I should write for working properly?

Aucun commentaire:

Enregistrer un commentaire