RISOLTO If batch

Stato
Discussione chiusa ad ulteriori risposte.

\_io_/

Utente Attivo
234
17
CPU
Intel Core i5-8600k
Dissipatore
Cooler Master ml240l rgb
Scheda Madre
Gigabyte Aorus z370 Ultra Gaming rev 1
HDD
Wd blue 1tb / Kingstone 128 gb
RAM
HyperX Fury 8 gb
GPU
Nvidia GTX 1060 6gb Gigabyte Aorus Windforce oc
OS
Windows 10
Ipotizziamo che io debba fare un programma molto semplice in batch, che legga in input un numero, e successivamente stampi un messaggio nel caso in cui il numero sia maggiore di 10, un messaggio diverso se il numero è tra il 10 e il 5 e un messaggio diverso ancora se il numero è minore di 5
Codice:
@echo off
set /p input=Inserire un numero:
if %tinput% lss 5 (@echo messaggio1)
if %input% ler 10(@echo messaggio2)
if %input% gtr 10(@echo messaggio3)
ora il mio dubbio è il seguente:

se in input inserisco un numero minore di 5, come faccio a non far stampare anche il messaggio2 (quello relativo al numero minore di 10)??
Scusate l'ignoranza, ma ho iniziato da poco a studiare il batch
Grazie in anticipo
 
Ultima modifica da un moderatore:

rodhellas

Utente Èlite
1,522
427
CPU
Ryzen 5 3600
Dissipatore
GELID Phantom
Scheda Madre
MSI B450 Gaming Plus Max
HDD
500GB m.2 + 2TB HDD
RAM
16GB Corsair LPX 3000mhz
GPU
Gigabyte GTX 960 OC
Audio
Integrata
Monitor
SyncMaster 223BW
PSU
Antec HCG-520M
Case
Meshify C
Net
Gigabit Fastweb
OS
Windows 10 64bit
Si,
if ... () else (
if ... () else ()
)
 

\_io_/

Utente Attivo
234
17
CPU
Intel Core i5-8600k
Dissipatore
Cooler Master ml240l rgb
Scheda Madre
Gigabyte Aorus z370 Ultra Gaming rev 1
HDD
Wd blue 1tb / Kingstone 128 gb
RAM
HyperX Fury 8 gb
GPU
Nvidia GTX 1060 6gb Gigabyte Aorus Windforce oc
OS
Windows 10
Ultima modifica:
  • Mi piace
Reazioni: rodhellas

rodhellas

Utente Èlite
1,522
427
CPU
Ryzen 5 3600
Dissipatore
GELID Phantom
Scheda Madre
MSI B450 Gaming Plus Max
HDD
500GB m.2 + 2TB HDD
RAM
16GB Corsair LPX 3000mhz
GPU
Gigabyte GTX 960 OC
Audio
Integrata
Monitor
SyncMaster 223BW
PSU
Antec HCG-520M
Case
Meshify C
Net
Gigabit Fastweb
OS
Windows 10 64bit
Figurati! :ok:
 
Stato
Discussione chiusa ad ulteriori risposte.

Entra

oppure Accedi utilizzando
Discord Ufficiale Entra ora!