Batch Files Tutorial - If Statement
July 31, 2009 - 10:11 pm
Jake “Master Jake” Chappell teaches you how to use the if statement when dealing with batch files.
Please comment and rate. If you like my video tutorials spread the word.
Website: http://masterjake.co.nr/
E-Mail: skateparkceasercash@yahoo.com
Duration : 0:5:20
[youtube Qr8L4x-qJ-Y]
July 31st, 2009 at 10:11 pm
How do I make it …
How do I make it say something if I enter the wrong variable? Like a password? How do I make it say like “That password is wrong” and can I make it have certain number of attempts? Like set it to 4 attempts and then it locks out?
July 31st, 2009 at 10:11 pm
Hehe
Hehe
July 31st, 2009 at 10:11 pm
thanks man im going …
thanks man im going to do one in the computer lap hehe
July 31st, 2009 at 10:11 pm
Scj0production At …
Scj0production At ur school the CMD is blocked… like you said. To unblock it go into notepad type
@echo off
command
@echo on
Then save it as a .bat file and open it. Should open CMD and not be blocked.
BTW im not responsable if u get cought.
July 31st, 2009 at 10:11 pm
I want to make one …
I want to make one on the school computer how do i get passed command prompt its locked or restricted
July 31st, 2009 at 10:11 pm
thanks!
thanks!
July 31st, 2009 at 10:11 pm
do it like this
…
do it like this
set /p blah=Enter Stuff:
if “%blah%”==”What is up” (
do some stuff
)
notice the quotes around the string with spaces and around the variable just because
July 31st, 2009 at 10:11 pm
How can i make the …
How can i make the user type in more than one word and have an if statement test it? Im making a batch file that says “Hello, how are you?” and I have to type in “Good, how are you? or “Not so good, how are you?” how would i make an if statement test if i typed in these two phrases? it doesn’t seem to work with multiple word but works with one word like in ur vid.
thanks!
July 31st, 2009 at 10:11 pm
by not putting the …
by not putting the pause statement lol
July 31st, 2009 at 10:11 pm
how ? xD
how ? xD
July 31st, 2009 at 10:11 pm
yes if you want
yes if you want
July 31st, 2009 at 10:11 pm
can i make it just …
can i make it just exit without pause when i type anything else than Y and y ?
July 31st, 2009 at 10:11 pm
no problem ;]
no problem ;]
July 31st, 2009 at 10:11 pm
nice dude i forgot …
nice dude i forgot how to do if statements and this way worked. thanks (oh ya i rated 5 stars)
July 31st, 2009 at 10:11 pm
your welcome xD
your welcome xD
July 31st, 2009 at 10:11 pm
thank you
and im …
and im gonna go search now for that music hehehe
thank you
July 31st, 2009 at 10:11 pm
i got it off …
i got it off limewire lol just searched “gta san andreas theme music” or something.
@echo off
set command=Command (enter y):
if /i %command%==y (
start program.exe <- whatever program
copy files location <- files and location
)
something like that
July 31st, 2009 at 10:11 pm
how would I go …
how would I go about doing something like this:
if (y is pressed)(run program at a location)
and also:
if (y is pressed)(copy files to a location)
and Im going to start making videos soon just for fun and where could I find that intro music that you used… its great
July 31st, 2009 at 10:11 pm
you need quotes …
you need quotes around it if theres spaces
July 31st, 2009 at 10:11 pm
it doesn’t work …
it doesn’t work with more than one word in the if statement, like if %talk%==not good it doesn’t do want i set it to do
July 31st, 2009 at 10:11 pm
ah ok, thnx
ah ok, thnx
July 31st, 2009 at 10:11 pm
because your …
because your echoing Yes/No not actually letting them type something. Change that line to:
set /p name=Yes/No
try that
July 31st, 2009 at 10:11 pm
why doesnt this …
why doesnt this work?
@echo off
color F
:namewrong
set /p name=Name:
Echo So your name is %name%?, type yes or no to confirm.
Echo Yes/No
pause
if %name%==yes goto nameright
if %name%==no goto namewrong
:nameright
pause
July 31st, 2009 at 10:11 pm
no… if you …
no… if you compile the batch and make a batch trojan… then infiltrate the system and implant the batch virus in the start up…. it is no longer a noobs virus.
If your going to call it ‘ineffective’… learn about batchs to its fullest before you comment about it being ‘noobish’.
July 31st, 2009 at 10:11 pm
lol
lol