[Batch] Incorrect Command Syntax!
Solved
Edgardu33
Posted messages
12
Registration date
Status
Member
Last intervention
-
Jesaispasquoimettre -
Jesaispasquoimettre -
Bonjour,
Here is the translated text:
Hello,
So here I have a small problem with the batch code that I will provide below.
When I open it, it closes very quickly but I was able to distinguish this:
"The command syntax is incorrect" :/
Here is the code:
Thank you in advance for your help.
Best regards, Edgardu33.
Here is the translated text:
Hello,
So here I have a small problem with the batch code that I will provide below.
When I open it, it closes very quickly but I was able to distinguish this:
"The command syntax is incorrect" :/
Here is the code:
@echo off cls title Calcul COLOR 0c echo --------------- echo Test de Calcul By Edgardu33 echo --------------- echo. :debut set /a n1=%random%%%10 set /a n2=%random%%%10 :reessayer echo %n1% x %n2% ? set /p cho=> if %cho%==%n1% * %n2% (goto oui) else (goto non) :oui echo Bravo !!! echo. echo. goto debut :non echo Mauvaise reponse !!! echo. echo. goto reessayer
Thank you in advance for your help.
Best regards, Edgardu33.
3 answers
Hello,
it must be these lines:
if %cho%==%n1% * %n2% (goto oui)
else (goto non)
replace these lines with:
set /a resultat=%n1% * %n2%
if %resultat%==%cho% (
goto oui
) else (
goto non
)
That's it, see you later!
it must be these lines:
if %cho%==%n1% * %n2% (goto oui)
else (goto non)
replace these lines with:
set /a resultat=%n1% * %n2%
if %resultat%==%cho% (
goto oui
) else (
goto non
)
That's it, see you later!