Batch Files Tutorial - Loops
Loading...
4,397
Loading...
Uploader Comments (MasterJake777)
see all
All Comments (43)
-
I used set /a like a million times for my mafia batch game. EVERYONE CHECK IT OUT!!! Free and no damn surveys
-
@MasterJake777 You teach better than my teacher :) Keep making vids, very useful! Do not respond to this.
-
@MasterJake777 Aaaah thank you very much! Noob mistake lol
-
oh kk
Loading...
Very good video! I had absolutely no knowledge of loops before I watches this, and now i know some of the basics, didn't understand /p and /a, though
maiahi0 2 months ago
@maiahi0 Thanks! Well essentially if you set var=value then it takes that value immediately without question. If you'd rather *prompt* the user to enter the value for the variable instead, then you need to use the /p switch. The /a switch is used if you need to use mathematical operations like +, -, *, / etc. when setting the variable. For example, this would not work:
set test=5+4
but this would:
set /a test=5+4
MasterJake777 2 months ago
turtleownage 2 months ago
@turtleownage This line: if %varloopcounter% LEQ %varcancel% (
%varcancel% needs to be %varloopcancel%
MasterJake777 2 months ago
hey is there a way you can loop a delete for folders or programs?
AnnieBoPookie 2 months ago
@AnnieBoPookie If you mean deleting *all* the files in a folder, then yes you can do that. Search on google "cmd recursive delete" and you should find tons of info on it!
MasterJake777 2 months ago