Hi everyone.
I wanted it when it comes out: Do I have to clear the user's temp? I write "yes" and cmd deletes all the temp folder and when I write "no" the cmd closes.
this is the code that I managed but that doesn't work.
@echo off
set /P scelta="Vuoi anche cancellare temp del tuo utente?"
if %scelta% = "yes" (
echo fregato!
pause
) else (
echo ciao!
pause
echo ciao and echo fregato it's just a test to see if it works
Code cmd (input)
Moderator: DosItHelp
Re: Code cmd (input)
You are doing a string comparison. The value on the left must equal the value on the right, character for character. That includes the quotes. You are also not using the correct comparison operator. It should be ==. You are also missing a closing parentheses.
Re: Code cmd (input)
Hello CmdUser202, try this . . .
I hope this helps!
Code: Select all
@echo off
set /P scelta="Vuoi anche cancellare temp del tuo utente?"
if /I '%scelta%' == 'yes' (
echo fregato!
) else (
echo ciao!)
pause