Introduction: Advanced Batch
PLEASE DIRECT ANY QUESTIONS YOU MAY HAVE TO MY BLOG:
http://tamsanh.com/blog/2008/07/11/batch-tutorial-3-advanced-batch/
I do not visit instructables anymore, and you will get a faster response that way.
Hey Guys! Tam Nguyen here. It's been a long time coming, but it's here now! I present to you the next instalment of my Batch Tutorials!
You may (or may not) have read my other instructables:
Basics of Batch
Slightly More Advanded Batch
This Instructable borrows some elements from the first two Instructables. Namely:
ECHO Command
CD Command
DIR Command
If you have not read the other two, I suggest looking over those commands right-quick. I'll wait here.
Ok!
By the end of this Instructable, you will be intimate with:
START Command
SET Command
IF Command
GOTO Command
and
> and >> Parameters
With these commands, you will be able to make dynamic batch files which can change according to user input, and create and expand.
So let's open up that good 'ol Command Prompt and get started!
Run -> cmd
Alternatively, you can go to:
Start->Program Files->Accessories->Command Prompt
My explainations in this instructable got a little long, so I've split up some commands into more than one page mainly for aesthetic purposes; I liked seeing the pictures while reading the text without having to scroll up and down.
Rule of thumb for picture viewing; Usually after every Code Snippet, there is a picture.
Enjoy!
Step 1: START Command
It's a simple command, and will help us warm up before we get to the harder commands.
The parameters of the command are exactly what you think they are.
START ThingToBeStarted.exePretty simple.
START WMPlayer.exeNot only can you START .exe's, you can also type a website in, and it will open up in your default browser!
START www.Instructables.comPretty easy, eh? Ok. Now let's move on to the real meat of the Instructable: SET Command.
Step 2: SET Command - String Theory (1/4)
Ah. Variables. The developer's ambrosia. Variables are bits of memory which are... err, variable. No IFs ANDs or NOTs about it! (lol, sorry). Ok! So how's this baby work?
Very simply, the parameters of the SET command are:
SET VariableName=Variable Value
SET by itself will create string variables.
SET TestVS=Test Variable String!
In this case, we just stored the value "Test Variable String!" into the variable TestVS.
Well that's all fun and games, but how do we retrieve the variable value? We use %.
Just add % around the variable name.
ECHO %TestVS%
Ok cool, but what else can it do?
Step 3: SET Command - Mr.Math (2/4)
@ECHO OFFSET Test=1ECHO %Test%SET Test=%Test%-1ECHO %Test%PAUSE
Aww, what happened? That should have worked! Wait a minute... what was that about SET commands only making strings?
Yes. The SET command by itself will only create a string variable, meaning it will create the most literal interpretation of the value.
It doesn't think of "1 - 1" equaling "0", it thinks of "1 - 1" equaling "1 - 1."
So how do we change that?
We want the variable not to be directly copied, but Evaluated. This means we want to turn it from a string into an expression! A very easy change, simply add a /a to the SET command.
Here's a simple batch file to see it in action, or you can just type it into the Command Prompt manual. I suggest the latter; it's much faster, and the code isn't too complicated, but if you really want the batch file, here it is:
@ECHO OFFSET /a Test=2+2ECHO %Test%PAUSE
Fantastic! It expressed it perfectly. Now we know what changes need to be made to our 'math test.bat'
@ECHO OFFSET /a Test=1ECHO %Test%SET /a Test=%Test%-1ECHO %Test%PAUSE
Ok. So let's run it!
Great! It worked perfectly! But what next?
Step 4: SET Command - User Input (3/4)
By adding /p to the SET parameters, it transforms it from a normal variable setter to a user-controlled variable setter.
SET /p UDefine=
With the /p, the program actually pauses, and waits for the User's input.
But wait, I don't see a /a parameter, does that mean that the variable is a string only?
Well, sort of. The /p of the parameters completely negates the /a, and if you attempt it, you simply get a Missing operand error. This means that the User Defined variable will not be able to evaluate expressions.
So what can one do?
Well, here's a tricky trick that I thought of that we can use.
The SET Command does not all the simultaneous use of parameters /p and /a, correct? Well, what about the sequential use of the parameters /a and /p?
Ahhh... you sly boots.
@ECHO OFFECHO Calculator Version 1.0ECHO.SET /p UDefine=SET /a UDefine=%UDefine%ECHO =ECHO %UDefine%ECHO.PAUSE
Nice calculator ya got there. If you haven't figured it out by now, the {{{ECHO.}}} is a blank line.
Isn't that cool-cool?
Step 5: SET Command - More Than Meets the Eye (4/4)
Have you tried just typing a variable by itself?
SET Test=Instructables%Test%
What a weird error... it says that the command "Instructables" is not recognized, not that %Test% had no syntax. So that means that DOS treats each variable like it was typed by hand. Well, what if...
SET Test=START cmd.exe%Test%
Awesome! It worked!
DOS treats each variable like it was typed by the user, and runs it accordingly. Here's an interesting code: (Just Copy/Paste; it's a bit tedious.)
@ECHO OffSET Variable1=ECSET Variable2=HSET Variable3=O CSET Variable4=ooSET Variable5=l!ECHO %Variable1%%Variable2%%Variable3%%Variable4%%Variable5%ECHO.%Variable1%%Variable2%%Variable3%%Variable4%%Variable5%Pause
Isn't that neat? Each variable contains two letters of the entire message (except Variable2), and putting the variables in order, each letter adds up, and finishes the entire command of ECHO Cool!
The SET command is one of the more complicated, and powerful commands of the DOS dictionary.
Step 6: IF Command - Everyone Is Equal (1/2)
For those who have never programmed before, the IF command is exactly how it sounds. If an expression in the syntax proves true (or NOT true) then the very next sequence of commands will carry out.
The basic command line goes like this:
IF %variable1%==%variable2% ECHO This part is executedor if you have more than one syntax.
@ECHO OFFIF %variable1%==%variable2% (ECHO This part is executed.ECHO So is this.) ELSE (ECHO If variable1 doesn&apost = variable 2, this happens.ECHO and this happens too.)
Note: The peculiar placing of parenthesis is not because I don't believe in organized code, but because if they're not in those places, the whole IF snippet will not work. Thus, if there Is any error with your IF code, it's most likely because of the parenthesis.
To run this particular batch, I actually used the Command Prompt itself, so that I could set the variables without having to edit the IfVariableTest.bat multiple times.
Step 7: IF Command - But I'm Greater Than You (2/2)
For those of us programmers, I know this seems like a simple task. Just do what all the other programming languages do!
Well hold your horses cowboy. Not so fast. A Batch file isn't just your regular ol' programming langage. Silly as it may seem, the "<" and ">" don't work with Batch files.
EQU - Equal - ==NEQ - Not EqualLSS - Less ThanGTR - Greater ThanLEQ - Less Than or Equal ToGEQ - Greater Than or Equal ToJust put these operands in place of the ==
Example:
IF 32 GTR 3 ECHO This Will Work
@ECHO OFFIF 32 GEQ 32 (ECHO 32 is Greater Than, or Equal to 32) ELSE (ECHO 32 is definitely Equal to 32)PAUSEIF 32 LSS 32 (ECHO 32 is Less Than 32? I think not.) ELSE (ECHO 32 is Not Less Than 32. End of story.)PAUSE
Step 8: GOTO Command
To use this command, you must first have a label in place. Labels look like this:
:Label1It's simply a colon before a non-spaced series of letters and/or numbers.
The GOTO command is structured like this:
GOTO Label1It's That Easy!
Come to think of it, I'm not really sure why I didn't put this in the Slightly Advanced Batch.
In any case, this command can be used to repeat a batch file by simply GOTO a label that executes the GOTO command again.
@ECHO OFF:RepeatMeECHO This will be repeated unless you hit "CTRL-C"GOTO RepeatMeThe batch file speaks the truth, by the way. CTRL-C is the universal Pause and Prompt for Termination. CTRL-S is simply Pause. But Closing the window works just as well.
The GOTO can skip, or reorder your code as well.
GOTO TurnEOffGOTO MultipleGotoECHO This ECHO is going to be skipped.:MultipleGotoGOTO 3:ENDPAUSEEXIT:1ECHO The EndGOTO END:3ECHO This will be displayed firstGOTO 2:TurnEOff@ECHO OFFGOTO MultipleGoto:2ECHO This is second, even though it&aposs last in the code.GOTO 1The above code was structured confusingly on purpose to emphasize the GOTO's ability to jump around in the code.
Step 9: > Parameter (1/2)
Its syntax is:
Command>FilenameOk, so let's say we're in a certain directory. We then use the DIR Command, which, if you read the Basics of Batch, you would know as showing the contents of your current directory.
C:\Users\Neo\>DIRWould normally output:
Volume in drive C is HP Volume Serial Number is BC7E-E26C Directory of C:\Users\Neo06/30/2007 11:14 AM <DIR> .06/30/2007 11:14 AM <DIR> ..03/17/2007 06:41 PM <DIR> .idlerc02/19/2007 03:14 PM <DIR> Contacts06/19/2007 10:44 PM <DIR> Desktop06/29/2007 08:47 AM <DIR> Documents06/19/2007 10:35 AM <DIR> Downloads02/19/2007 03:14 PM <DIR> Favorites02/19/2007 03:14 PM <DIR> Links05/12/2007 04:01 PM <DIR> Music06/30/2007 01:20 AM <DIR> Pictures04/07/2007 03:08 PM <DIR> Saved Games02/19/2007 03:14 PM <DIR> Searches03/01/2007 07:23 PM 242,947 Test Record.wma06/19/2007 10:39 AM <DIR> Videos06/18/2007 09:57 AM 1,324,574 wp_screenprint_mc.pdf06/18/2007 09:59 AM 73,996,533 wp_tshirt_full.mp4 4 File(s) 75,564,054 bytes 14 Dir(s) 132,927,537,152 bytes freeBut, if we add the > and to it...
C:\Users\Neo\DIR>DIRContents.txtWe don't get an output, but instead, we get a brand-spankin'-new Text File named DIRContents.txt which has the Output in it! Coolness!
But wait, there's a problem! I want to have multiple outputs in the same file, but my > just keeps overwriting it, and not adding it! What do I do?
Step 10: >> Parameter (2/2)
The >> is just like the >, but instead of completely overwriting the specified file, we Add to it!
So let's try it.
DIR>>DIRContents.txtNeat! Worked Perfectly! So wait. Does that mean that I can write anything I want into a text file? I want to try it!
Batch Is Awesome>Awesome.txtWhat? Why didn't that work? It's because the parameter only writes the output of Legitimate Commands, not just anything you type in. But, this is a problem that is simply solved. Remember, the parameters record the Output of Commands. What command has an output that we can control?
Right! The ECHO Command!
ECHO Batch Is Awesome>Awesome.txtECHO I&aposm so glad that I know it.>>Awesome.txtYay! Remember. The >> adds the Output to the very next line of the file.
Step 11: Example Implementation
This code will add 1 to a variable continually, and output the result indefinitely.
@ECHO OFFSET /a num=1:RepeatECHO %num%SET /a num=%num%+1GOTO Repeat
This code will start CMD.exe 5 times.
@ECHO OFFSET /a RepeatNum=5:OpenIF %RepeatNum%==0 GOTO EndSTART CMD.exeSET /a RepeatNum=%RepeatNum%-1GOTO Open:End
This code will create a batch file in the C:\Users\Neo, and will run it.
@ECHO OFFCHDIR C:\Users\NeoECHO @ECHO OFF>Hello.batECHO ECHO Hello!>>Hello.batECHO ECHO I&aposm in your C Drive!>>Hello.batECHO PAUSE>>Hello.batC:\Users\Neo\Hello.batPause
This is a little game batch. You must guess the number.
@ECHO OFFSET /a GuessNum=0SET /a Answer=%RANDOM%ECHO Guess what Number I&aposm thinking of.:RetrySET /p Guess=IF %Guess% LSS %Answer% ECHO My Number is Higher.IF %Guess% GTR %Answer% ECHO My Number is Lower.IF %Guess%==%Answer% GOTO ENDECHO.SET /a GuessNum=%GuessNum%+1GOTO Retry:ENDECHO You are Correct! The Answer was %Answer%ECHO It took %GuessNum% Guesses.ECHO.PAUSEAnd this one, I like a lot. If you're not careful, however, it can get out of hand fairly quickly, depending on your computer's ability. What this file does is it indefinitely creates numbered text files in a directory called lolnumbers. Each of these text files contains the DIR of the lolnumbers directory. The thing is, the directory is constantly getting fuller and fuller with text files, so each consecutive text file is larger than the last. The result of this is a folder whose total size gets larger and larger every second.
@ECHO OFFSET /a num=1MKDIR lolnumbersCD lolnumbers:RestartDIR>%num%.txtSET /a num+=1GOTO Restart
These are pretty basic codes. Experiment with them to your heart's content.
Step 12: Conclusion: Final Notes
Just a few reminders before I go.
Remember:
When SETing a variable, Never put a space between the variable and its value.
YES:
SET variable1=ValueThe extra space will cause your variable to be blank.
NO:
SET variable1 = Value
Also, the multiple IFs. Remember to format the Parenthesis properly:
YES:
IF 1==1 (ECHO One Equals One!) ELSE (ECHO Something&aposs wrong with this program.)
NO:
IF 1==1(ECHO One Equals One!)ELSE(ECHO Something&aposs wrong with this program.)
Also, there are built-in variables as well.
%CD%%DATE%%TIME%%RANDOM%%CD% Expands to the current directory. Basically, the path behind the first >
%DATE% and %TIME% are the Date and Time.
%RANDOM% gives a random number between 0 and 32767. The range cannot be changed, I don't think.
And that's basically it! I hope you enjoyed this instructable, I worked really hard on it.
Hopefully, it will make up for the 10 Month Absence.
Now the bad news. I will have a bit of trouble answering any questions in the next few months, because I will be out of Country. But if you do have a question, just leave a comment anyone. If I do get access to a computer, I'll be sure to answer, but I don't think that will be necessary; Instructables is a friendly community, and I'm Sure that someone out there will help you in your plight.
Happy Batching!
165 Comments
1 year ago on Step 12
why would you do it like that? just make 1 hole file to download or just post it raw and after /or befor you will to that explaning thing i know a bit about batch files
3 years ago
I Made This Batch Calculator. Can Someone Develop it ???
:: Batch Calculator
@echo off
title Batch Calculator
color a
echo Welecome To Batch Calculator
echo ============================
:a
echo.
echo.
echo + = Add
echo - = Subtract
echo / = Division
echo * = Multiple
echo.
echo.
echo Type Your Calculation
echo.
set /p ui=
if %ui%==About (goto ab)
set /a ui=%ui%
echo.
echo Answer is %ui%
pause
:b
cls
echo Next Calculation ? (Y/N)
set /p nxt=
if %nxt%==y (goto a)
if %nxt%==Y (goto a)
if %nxt%==n (goto end)
if %nxt%==N (goto end)
echo Invalid Choice
goto b
:end
echo Thanks For Using Batch Calculator
Pause
exit
:ab
echo =====+Batch Calculator+=====
echo =====+Developed By HRS+=====
pause
cls
goto a
:: Developed By </HRS>
4 years ago
it is too dificult to understand the previoius ones are better
4 years ago
Please help me with below requirement . I need to remove last blank line from the CSV file . I need it on Urgent basis. Please help me ..
4 years ago
NOBODY HERE?
4 years ago
THANK YOU M.R TECTECHNICALGUY
8 years ago on Introduction
Hem hem. Here it is an animation box, thank you.
@echo off
setlocal enabledelayedexpansion
set Counter=0
set Schalter=2
set Width=0
:: The weird symbols are replaced by lines in the CMD-window
:: All options that are marked by a little point are finite
:: --- All the others are unfinite, the program has to be closed by X to
:: view another animation
:: --- "c4: Star Wars" is not infinite, but it takes quite a lot time
:Start
call :ResetVariables
title Animation Box
mode con cols=80 lines=25
echo ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃû
echo ºú1: Installation ³ú 9: Arrow left ºúc1: 1min º
echo º 2: Slow loading ³ú10: Arrow right ºúc2: 2009 º
echo º 3: Fast loading ³ 11: Skull º c3: Bat disco º
echo º 4: Big loading ³ú12: Dos Techno Virusº c4: Star Wars º
echo ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃà ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃù
echo º 5: Matrix ³ú13: Winhound ºúm1: Matrix part 1 º
echo º 6: Epilepsy ³ú14: Expand window ºúm2: Matrix part 2 º
echo ºú7: Naked woman ³ ºúm3: Matrix part 3 º
echo º 8: Fill window ³ ºúm4: Matrix part 4 º
echo ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃü
set /p choice=--^>
cls
if "%choice%" == "5" set Schalter=
call :%choice%
goto :Start
:: "Counter" is the amount of finished %, yet (at last 100%)
:: "Display" is the progress bar
:: --- This bar consists of the half of the %-amount (at last 50)
:: --- The bar moves from left to right
:1
title Animation Box - Installation
set /a Counter=%Counter% + 1
set /a Display=%Counter% / 2
FOR /L %%A IN (1,1,%Display%) DO (
set Display=!Display!²
)
cls
echo New files are copied... %Counter%%%
echo ²!Display:~2,47!
ping localhost -n 1 >nul
if "%Counter%" == "100" goto :1-End
goto :1
:1-End
echo.
echo Installation complete.
pause >nul
EXIT /B
:2
cls
title Animation Box - Slow loading
echo Opening file.
echo.
echo I I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I² ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I² ² ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² ² ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² ² ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² ² ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² ² ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² ² ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² ² ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² ² ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² ² ²I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² ²I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ² I
ping localhost -n 1 >nul
cls
echo Opening file.
echo.
echo I ²I
ping localhost -n 1 >nul
cls
goto :2
:: "Counter" determines the length of the row
:: "Display" is the row
:: "Schalter 1" = From left to right
:: "Schalter 2" = From right to left
:3
title Animation Box - Fast loading
cls
echo [!Display!]
set Display=
if "%Counter%" == "0" set Schalter=1
if "!Schalter!" == "1" set /a Counter=%Counter% + 1
if "%Counter%" == "41" set Schalter=2
if "!Schalter!" == "2" set /a Counter=%Counter% - 1
if "!Schalter!" == "1" FOR /L %%A IN (1,1,%Counter%) DO set Display=!Display!±
if "!Schalter!" == "1" FOR /L %%A IN (%Counter%,1,40) DO set Display=!Display!
if "!Schalter!" == "2" FOR /L %%A IN (1,1,%Counter%) DO set Display=!Display!
if "!Schalter!" == "2" FOR /L %%A IN (%Counter%,1,40) DO set Display=!Display!±
goto :3
:: The subpoint "4_DisplaySpace" is used to compress the animation's size in the file.
:: The FOR-part in the middle of the animation is used for the same reason.
:: --- It counts the amount of spaces between the left stars and the loadbar, and
:: between the right stars and the loadbar.
:: --- There are at last 65 spaces.
:: --- The entire animation counts 79 columns. The loadbar is 11 columns wide.
:: From the left 68 columns, 2 are the stars at the left and the right.
:: 66 columns left, 65 of them spaces (79 - 11 - 2 = 66)
:: The variable "line" is used to compress the animation's size in the file, too.
:4
title Animation Box - Big loading
mode con lines=15
goto :4_DisplayBars
:4_DisplaySpace
echo *******************************************************************************
ping localhost -n 1 >nul
cls
echo.
echo.
echo.
echo.
echo *******************************************************************************
exit /b
:4_DisplayBars
call :4_DisplaySpace
echo * *
echo * *
echo * *
call :4_DisplaySpace
echo *8 *
echo *8 *
echo *8 *
call :4_DisplaySpace
echo *88 *
echo *88 *
echo *88 *
call :4_DisplaySpace
echo *888 *
echo *888 *
echo *888 *
call :4_DisplaySpace
echo * 888 *
echo * 888 *
echo * 888 *
call :4_DisplaySpace
echo *8 888 *
echo *8 888 *
echo *8 888 *
call :4_DisplaySpace
echo *88 888 *
echo *88 888 *
echo *88 888 *
call :4_DisplaySpace
echo *888 888 *
echo *888 888 *
echo *888 888 *
call :4_DisplaySpace
echo * 888 888 *
echo * 888 888 *
echo * 888 888 *
call :4_DisplaySpace
echo *8 888 888 *
echo *8 888 888 *
echo *8 888 888 *
call :4_DisplaySpace
echo *88 888 888 *
echo *88 888 888 *
echo *88 888 888 *
call :4_DisplaySpace
FOR /L %%A IN (0,1,66) DO (
set Length=
set Width=
FOR /L %%D IN (1,1,%%A) DO set Length=!Length!
FOR /L %%E IN (%%A,1,65) DO set Width=!Width!
set Line=*!Length!888 888 888!Width!*
FOR /L %%R IN (1,1,3) DO echo !Line!
call :4_DisplaySpace
)
echo * 888 888 88*
echo * 888 888 88*
echo * 888 888 88*
call :4_DisplaySpace
echo * 888 888 8*
echo * 888 888 8*
echo * 888 888 8*
call :4_DisplaySpace
echo * 888 888 *
echo * 888 888 *
echo * 888 888 *
call :4_DisplaySpace
echo * 888 888*
echo * 888 888*
echo * 888 888*
call :4_DisplaySpace
echo * 888 88*
echo * 888 88*
echo * 888 88*
call :4_DisplaySpace
echo * 888 8*
echo * 888 8*
echo * 888 8*
call :4_DisplaySpace
echo * 888 *
echo * 888 *
echo * 888 *
call :4_DisplaySpace
echo * 888*
echo * 888*
echo * 888*
call :4_DisplaySpace
echo * 88*
echo * 88*
echo * 88*
call :4_DisplaySpace
echo * 8*
echo * 8*
echo * 8*
goto :4_DisplayBars
:: Matrix effect coming from below
::
:: If "Schalter" equals a space (" "), then the figures are moved one space to the right
:: If "Schalter" equals nothing (""), then the figures aren't moved.
::
:: %%A equals the last line, yet (the one at the top)
:: %%B equals the new line (%%A moved one line towards the top)
:: --- %%B equals the last %%A
::
:: In the last FOR-command, all lines are displayed. In case if the screen isn't filled, yet,
:: the program will put a blank (echo.)
:5
title Animation Box - Matrix
color 0a
ping localhost -n 1 >nul
cls
if "%Schalter%" == "" (set Schalter= ) ELSE (set Schalter=)
FOR /L %%A IN (1,1,23) DO (
set /a B=%%A + 1
FOR %%B IN (!B!) DO set Line%%A=!Line%%B!
)
set Line24=%Schalter%%random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1% %random:~0,1%
FOR /L %%A IN (1,1,24) DO if defined Line%%A (echo !Line%%A!) ELSE (echo.)
goto :5
:: Flickering CMD-window in "white-black" "black-white" (background-font)
:6
title Animation Box - Epilepsy
ping localhost -n 1 >nul
cls
if "%color%" == "0f" (set color=f0) ELSE (set color=0f)
color %color%
FOR /L %%A IN (1,1,9) DO echo.
echo 88888888 88 88 88 88
echo 88 88 88 88 88
echo 88 888888 88
echo 88 88 88888888 888888 88 888888 888888 88 888888
echo 88 88 88 88 88 88__88 88 88 88 88 88 88 88__88
echo 88 88 88 88 88 88____ 888888 888888 888888 88 88____
FOR /L %%A IN (1,1,8) DO echo.
goto :6
:7
title Animation Box - Naked woman
color 05
mode con lines=180
echo .,,,,,..
echo _.zJ??c,J$hhhhh:::::??c,
echo ,J?:::::J99?????h::?h:::::?h
echo zâ::::::$9999??h::::??h:?h:::?$.
echo J:::J$?::6;hh:::::??i:::?h::$::::$
echo J::9F::hhh6T??h:??h:::?$:::?h::$:::$
echo J::9?h?:::$:?$C:??h:??h:::9h::?h:?$::$
echo ;F:JF9?:J?:$h::?h:::?h::?h::?h::?$::h::h
echo $::C:CjF:j?$9h::?h:::?h:::9h::?h::$::9:9?
echo $:$:$9?:C9?$:$:::?h::::$:::?h:::$::$::$:$.
echo CJ?9:C:$:$:9::$:::?h::::?h:::$:::$::9::$:$
echo $$:$J:9:9J$:$::$:::?h::::?h:::?h::$::$:?h:,
echo C:F$:9:$$ââ?$::$:::?h::::?h:::?h::$::h:?:9
echo :9:C::C?$â.`.$::h:::?h::::9::::$::9::?h:::
echo J:$:C::$:$â.`.`â"â?:::?h::::$::::$::$::$:::$
echo $:9:C:::$â`.`.`.`.âhjj?h::::$:::?h::h::::$
echo $:9::::hc?Jccc`.`.`.`z$??h:::h:::$::9::9::9
echo ?:9:9:::iâ,cccJâ`.`.`JâPlcc$h::::::$:?C:::9
echo $:C:$:9'J$?$$$FPâ.`jF3F`$$$ 3?h::::?:h::$:J
echo :$::$âââ?c?$CJ`.`.$â.`?+??â`.`h::::$::X:::
echo h?C:9`.`.`.`.`.`.`$â.`.`.`.`.âh:::9h:C:::
echo `h$:9`.`.`.`.`.`.`??`.`.`.`.`.`?h:::C:C:J
echo `hh?h.`.`.`.`.`.`.`Lâ`.`.`.`.`.3::hC:F:F
echo 3:$$,`.`.`.`.`.`;3`.`.`.`.`.:C:9:9:$
echo ?h:?c`.`.`.`â"??â`.`.`.`.`.`.3::$:$:F
echo ??h`.`.`.`.`.`.`.`.`.`.`.`.$??:$:P
echo ?,.`.`.cJ?????QI$?.`.`.`.$::$:$
echo $,`.`.3?hc,c??$â`.`.`.`$:::P
echo $9,.`.`?hCCCJâ`.`.`.`.z?9:Jâ
echo ?h?h`.`.`.`.`.`.`.`.,$;;;,
echo â"?,`.`.`.`.`.`.,$?;;;;9.
echo ?i.`.`.`.`.,J?;;;;;;;?c_
echo $h,.`.`,cc?;;;;;;;;;;;;?c,
echo $;;???;;;;;;;;;;;;;;;;;;;;?hc,
echo 3;;;;;;â`.`.`.`.`.`;;;;;;;;;;;???hhhccc,,_
echo ;;;;â`.`.`.`.`.`.`;;;;;;;;;;;â.`.`.`.`.`â?h .
echo ;;;â.`.`.`.`.`.`;;;;;â.`.`.`.`.`;;;â.`.`.`.`?
echo $;;â`.`.;.`.,;;;;;â.`.`.`.`.,;;;;;â.`.`.`.`.`.
echo C;;â`.`,;;;;;;;â`.`.`.,;;;;;;â`.`.`.`.`.`.`.`.
echo ,$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.`.`.`.`,F.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`
echo.
pause >nul
color 07
exit /b
:: "Counter" determines the heigth of the last row (no matter if from below or above)
:: "Width" determines the width of each line (from left to right)
:: "Line%%A" are the lines 1 to 24, undepending from their length or width
:: "Schalter1" = From above to below
:: "Schalter2" = From below to above
:: :: ----Line1-------------------------------------
:: :: -C--Line2----------W-i-d-t-h------------------
:: :: -o--Line3-------------------------------------
:: :: -u--Line4---------|---------Schalter 2--------
:: :: -n--Line5---------|---------------------------
:: :: -t--Line...-------V-------------A-------------
:: :: -e--Line23----------------------|-------------
:: :: -r--Line24----Schalter 1--------|-------------
:: :: ----Line25------------------------------------
:8
title Animation Box - Fill window
cls
if "%Counter%" == "0" (
set Schalter=1
set /a Width=!Width! + 1
)
if "!Schalter!" == "1" set /a Counter=%Counter% + 1
if "%Counter%" == "25" (
set Schalter=2
set /a Width=!Width! + 1
)
if "!Schalter!" == "2" set /a Counter=%Counter% - 1
if "!Schalter!" == "1" FOR /L %%A IN (1,1,%Counter%) DO set Line%%A=
if "!Schalter!" == "1" FOR /L %%A IN (1,1,%Counter%) DO FOR /L %%B IN (1,1,!Width!) DO set Line%%A=!Line%%A!±
if "!Schalter!" == "2" FOR /L %%A IN (24,-1,%Counter%) DO set Line%%A=
if "!Schalter!" == "2" FOR /L %%A IN (24,-1,%Counter%) DO FOR /L %%B IN (1,1,!Width!) DO set Line%%A=!Line%%A!±
FOR /L %%A IN (1,1,24) DO if defined Line%%A echo !Line%%A!
ping localhost -n 1 >nul
goto :8
:9
title Animation Box - Arrow left
mode con lines=25
echo.
echo.
echo.
echo.
echo 8888
echo 8888
echo 8888
echo 8888
echo 8888
echo 8888
echo 8888888888888888888888888888888888888888888888
echo _88888888888888888888888888888888888888888888888
echo 88888888888888888888888888888888888888888888888
echo 8888888888888888888888888888888888888888888888
echo 8888
echo 8888
echo 8888
echo 8888
echo 8888
echo 8888
pause >nul
exit /b
:10
title Animation Box - Arrow right
mode con lines=25
echo.
echo.
echo.
echo.
echo 8888
echo 8888
echo 8888
echo 8888
echo 8888
echo 8888
echo 8888888888888888888888888888888888888888888888
echo 88888888888888888888888888888888888888888888888_
echo 88888888888888888888888888888888888888888888888
echo 8888888888888888888888888888888888888888888888
echo 8888
echo 8888
echo 8888
echo 8888
echo 8888
echo 8888
pause >nul
exit /b
:: Blinking skull in "black-red" "darkred-grey" (background-font)
:11
title Animation Box - Skull
mode con lines=54
echo.
echo _________ _________
echo / \ / \
echo / \ / \
echo I OOO I I OOO I
echo I OOO I I OOO I
echo \ / \ /
echo \__ __/ \__ __/
echo \ \ / /
echo \ \ ___________________ / /
echo \ \ _/ \_ / /
echo \ \ _/ \_ / /
echo \ \ _/ \_ / /
echo \ / ,adPba, ,adPba, \ /
echo \ / a8"""""8a a8"""""8a \ /
echo \/ Y8888888Y Y8888888Y \/
echo / \@@@@@@@/ \@@@@@@@/ \
echo I @@@@@ @@@@@ I
echo I ,aAa, I
echo I a"""""a I
echo I 8YYYYY8 I
echo I 9888887 I
echo I @@@@@ I
echo I I
echo \ ___________________ /
echo / \ ² ² / \
echo / \ _____²_________²___ / \
echo / /\_ _/\ \
echo / / \_ _/ \ \
echo / / \_ _/ \ \
echo / / \___________________/ \ \
echo / / \ \
echo __/ (_ _) \__
echo / \ / \
echo / \ / \
echo I OOO I I OOO I
echo I OOO I I OOO I
echo \ / \ /
echo \_________/ \_________/
echo.
echo.
echo 888888 88 88 88
echo 8888888 88 88 88
echo 88 88 88 88 88
echo 88 88 aa88aa 88 88
echo 88 88 YY88PY 88 88
echo 88 88 88888888 88888888 88 88888888 88
echo 88 88 88 88 88PYYY88 88 88888888 88
echo 88 88 88888888 88 88 88 88 88
echo 8888888 88 88aaaa88 88aaaaa 88 88 88
echo 888888 88888888 888888888 88888888 88 88 88
:11_Colour
color 0c
FOR /L %%A IN (1,1,6) DO ping localhost -n 1 >nul
color 47
FOR /L %%A IN (1,1,6) DO ping localhost -n 1 >nul
goto :11_Colour
:: Dos Techno Virus from the MS-DOS-times. It displays "TECHNO" all over again.
:: This animation stops after 25 lines (25 * 80 = 2000)
:: --- 25 = total amount of visible lines in one CMD-window
:: --- 80 = total amount of columns in one CMD-window
:: It sets the variable "M" to the entire code
:: There are 3 spaces between each "TECHNO"
:: When "C" equals 2,3 or 4, "L" is always a space
:: --- Else if "C" equals "0", the next letter is added to "M"
:: --- Either T,E,C,H,N or O (= TECHNO)
:: L = Letter
:: C = Changed
:: M = Message
:12
title Animation Box - Dos Techno Virus
set L=
set M=
set C=0
FOR /L %%A IN (1,1,2000) DO (
if "!C!" == "1" set C=0
if "!C!" == "2" (
set L=
set C=1
)
if "!C!" == "3" (
set L=
set C=2
)
if "!C!" == "4" (
set L=
set C=3
)
if "!C!" == "0" if "!L!" == "N" (
set L=O
set C=4
)
if "!C!" == "0" if "!L!" == "H" (
set L=N
set C=1
)
if "!C!" == "0" if "!L!" == "C" (
set L=H
set C=1
)
if "!C!" == "0" if "!L!" == "E" (
set L=C
set C=1
)
if "!C!" == "0" if "!L!" == "T" (
set L=E
set C=1
)
if "!C!" == "0" if "!L!" == " " (
set L=T
set C=1
)
if "!Cursor!" == "Ã" (set Cursor=Ã) ELSE (set Cursor=Ã)
set M=!M:~0,-1!!L!!Cursor!
echo !M!
ping localhost -n 1 >nul
cls
)
pause >nul
exit /b
:: Animation of a tiger's head
:: ^ are used to allow | in the animation
:13
title Animation Box - Winhound
color 0c
echo $$$$ $$$$$$'
echo $$$$.$$$ $$$$$$$$.
echo $$$$$$'$$$$$$$$$$$$$$$$$$$$$$$$$
echo $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
echo $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
echo $$$$$$$$$$....0ø)`$$;$$$$$....0ø) , ,
echo $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ / /
echo $$$$$$$$$$_$$$$$$$$$$$$$$$$$$$$$$./ /
echo $$$$$$$$$_$$$$$'$$$$$$$$.$$.$$$`$$./
echo $$$$$$$$$_$$$$$$$'$$$$$.$$$$.$$$`$$---"
echo $$$$$$$$$$_$$$$$$$$$$$$$$____$$$$$$`
echo $$$$$$$$$$$$_$$$$$$$$$$$$$_$$$$$$
echo $$$$$$$$$$$$$$$$___^| /'___^| /$
echo $$$$$$$$$$$$$$_____^| /_____^| /$
echo $$$$$$$$$$$$$__eeee^|/____$$^|/
echo $$$$$$$$$$$$$__,___,____$$
echo $$$$$$$$$$$$$$__,___,____$$
echo $$$$$$$$$$$$ $$___/^|___,__$/^|
echo $$$$$$$$$$$ $$_/ ^|,_____/ ^|
echo $$$$$$$$$$ $/ ^|_____/ ^|$
echo $$$$$$$$$ $$$$$$$$$$$$$
echo $$$$$$$$ $$$$$$$$$$$
pause >nul
color 07
exit /b
:: Expands the window
:: "Lines" is always 55 less than "columns"
:14
FOR /L %%A IN (81,1,160) DO (
set /a lines=%%A - 55
mode con cols=%%A lines=!lines!
ping localhost -n 1 >nul
)
pause
exit /b
:: "(60,-1,0)" counts backwards
:C1
title Animation Box - 1 min
FOR /L %%A IN (60, -1,0) DO (
echo %%A
ping localhost -n 2 >nul
)
msg %username% One minute is over. 2>nul || pause >nul
exit /b
:: The "2009" written in zeros is shown longer than the others
:: --- Still no reasonable explanation for that
:C2
title Animation Box - 2009
echo __//////____///////____///////_____///////__
echo _////////__/////////__/////////___//_____//_
echo _//____//__//_____//__//_____//___//_____//_
echo ______//___//_____//__//_____//____////////_
echo _____//____//_____//__//_____//__________//_
echo ____//_____//_____//__//_____//__________//_
echo ___//______//_____//__//_____//___//_____//_
echo _////////__/////////__/////////___//_____//_
echo //////////__///////____///////_____///////__
ping localhost -n 2 >nul
cls
echo __000000____0000000____0000000_____0000000__
echo _00000000__000000000__000000000___00_____00_
echo _00____00__00_____00__00_____00___00_____00_
echo ______00___00_____00__00_____00____00000000_
echo _____00____00_____00__00_____00__________00_
echo ____00_____00_____00__00_____00__________00_
echo ___00______00_____00__00_____00___00_____00_
echo _00000000__000000000__000000000___00_____00_
echo 0000000000__0000000____0000000_____0000000__
ping localhost-n 2 >nul
cls
echo __888888____8888888____8888888_____8888888__
echo _88888888__888888888__888888888___88_____88_
echo _88____88__88_____88__88_____88___88_____88_
echo ______88___88_____88__88_____88____88888888_
echo _____88____88_____88__88_____88__________88_
echo ____88_____88_____88__88_____88__________88_
echo ___88______88_____88__88_____88___88_____88_
echo _88888888__888888888__888888888___88_____88_
echo 8888888888__8888888____8888888_____8888888__
ping localhost -n 2 >nul
cls
echo __@@@@@@____@@@@@@@____@@@@@@@_____@@@@@@@__
echo _@@@@@@@@__@@@@@@@@@__@@@@@@@@@___@@_____@@_
echo _@@____@@__@@_____@@__@@_____@@___@@_____@@_
echo ______@@___@@_____@@__@@_____@@____@@@@@@@@_
echo _____@@____@@_____@@__@@_____@@__________@@_
echo ____@@_____@@_____@@__@@_____@@__________@@_
echo ___@@______@@_____@@__@@_____@@___@@_____@@_
echo _@@@@@@@@__@@@@@@@@@__@@@@@@@@@___@@_____@@_
echo @@@@@@@@@@__@@@@@@@____@@@@@@@_____@@@@@@@__
ping localhost -n 2 >nul
exit /b
:: Background and font changing their colors
:C3
color 6a
ping localhost -n 1 >nul
color 8f
ping localhost -n 1 >nul
color 3e
ping localhost -n 1 >nul
color f9
ping localhost -n 1 >nul
color 01
ping localhost -n 1 >nul
color 09
ping localhost -n 1 >nul
color 67
ping localhost -n 1 >nul
color 43
ping localhost -n 1 >nul
color d4
ping localhost -n 1 >nul
color a7
ping localhost -n 1 >nul
color c1
ping localhost -n 1 >nul
color f0
ping localhost -n 1 >nul
color b0
ping localhost -n 1 >nul
color ab
ping localhost -n 1 >nul
color ce
ping localhost -n 1 >nul
color 9e
ping localhost -n 1 >nul
color a3
ping localhost -n 1 >nul
color 1e
ping localhost -n 1 >nul
color fd
ping localhost -n 1 >nul
color c7
ping localhost -n 1 >nul
color c4
ping localhost -n 1 >nul
color 91
ping localhost -n 1 >nul
color 61
ping localhost -n 1 >nul
color 6f
ping localhost -n 1 >nul
color 01
ping localhost -n 1 >nul
goto :C3
:: Using "telnet" to connect to a website that shows Star Wars 3 in batch
:C4
telnet towel.blinkenlights.nl
exit /b
:: Matrix animations from a random picture found in google
:: --- There are 7 animations, 4 have been finished, yet
:: --- The animations are from the Linux command prompt
:M1
title File System - File Manager
color 0a
mode con cols=110 lines=50
echo File Edit View Go Help
echo î î î î î
echo ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÿ ÃÃÃûÃÃÃÃÿÃÃÃÃÃÃÃÿ
echo ³ ÃÃà ³ ºÃà º³home³³à shaun³
echo ³ [ ] shaun ³ ÃÃÃüÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ
echo ³ ÃÃà ³
echo ³ ³ ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÿ
echo ³ -^> ³ ³ ³
echo ³ Trash ³ ³ ³
echo ³ à ³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ÃÃÃÃÃÿ ³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ³ ³ Desktop ³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ÃÃÃÃÃÃà ³ ³ ³
echo ³ ³ ³ bin boot dev etc home lib lost+found ³
echo ³úúúÃÃÃúúúúúúúúúúúúúúúúúúúúúú³ ³ ³
echo ³úúúÃÃÃúúúúFileúsystemúúúúúúú³ ³ ³
echo ³úúúÃÃÃúúúúúúúúúúúúúúúúúúúúúú³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ³ ³ ³
echo ³ ³ ³ media mnt opt proc root sbin srv ³
echo ³ ³ ³ ³
echo ³ ³ ³ ³
echo ³ ³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ³ ³ ÃÃà ÃÃà ÃÃà ÃÃà ³
echo ³ ³ ³ ³
echo ³ ³ ³ sys tmp usr var ³
echo ³ ³ ³ ³
echo ³ ³ ³ ³
echo ³ ³ ³ ³
echo ³ ³ ³ ³
echo ³ ³ ³ ³
echo ³ ³ ³ ³
echo ³ ³ ³ ³
echo ³ ³ ³ ³
echo ³ ³ ³ ³
echo ³ ³ ³ ³
echo ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ
pause >nul
color 07
exit /b
:M2
title Animation Box - Matrix part 2 - shaun@hacktop: cmatrix
color 0a
mode con cols=89 lines=33
echo e Y ^| - g ' ^| ? x 9 3 : $ S Q 7 / i
echo s I $ 3 ! o 2 } 7 L E 2 H I n 0 G ^( n ^^
echo Q : ; : 9 + { " 3 A R 8 + A > > y ] u j %%
echo + A ^) 7 B v M / \ " 6 / # Z 5 t j F # s 0
echo F ? _ { Z + N y K ^& C ? n l b Y l \ X T c Y ^|
echo B @ r I m [ E C ? I Q 5 , { h W p y 7 @ B . 6 c
echo Z _ e X 3 " V A V ` T h G r : s f 0 ` * , U
echo H Z I ^) x $ 5 1 q @ S = J R 9 B c ^& + r S
echo $ S # $ E d D ] Y \ h t 0 S " i y N Q ^| J
echo s P , C G h R = 7 W \ ^> M ^& 9 %% m x q ` b
echo ^> j s s Q ) _ e C : \ \ ! . b X ^< z - V w '
echo $ R U ! D b J t ^> P ^| ' ^^ ^> ^& P i K k f _ N 0
echo : Y 1 A # e ! ^( , / C 4 h , ? P P v n z ? 2 b 0
echo u q z $ v s p ; ; 2 w ' ] R \ 4 M o _ ? %% z H
echo r $ N # g S j K ; D z J C z 5 9 \ 4 A { c y * X p
echo _ S 0 k K = c B ^^ : J V P A { 2 ^( ' : I q R u 8
echo C . 2 j = X \ . l L Y f $ q 3 C = D t g D _ b /
echo { ^< %% 9 i - y a { F V u j X _ 3 v ^( 2 ^& 9 - \ 3
echo e 7 n v I " V F 5 Q ? B + k , 5 e 4 _
echo S : t ? D W 8 y D K ` @ U = @ 6 5 4 -
echo J ? t ' ) I ^^ n $ f * D c k r L Q J x e b
echo q ^^ u Q b 3 " 0 \ x 0 6 %% ` n [ c 8 - m
echo + $ i L ? L Y P q Z Z f i 8 b w W f c t q
echo @ Z L d q ` V a [ ; S c p 6 o X 1 4 F i
echo / 4 ^> : v ! q " P " d M c X 2 - ^> t 5 i R
echo : ? o 9 c B / ? * 0 ^^ e S 1 r O N ^( x ? * E
echo 8 D # ^| L q 8 V / i 9 a k { ^) n A y 8 o { `
echo 3 ? \ V t Y { ^< G ^& # } 5 c J e h p t Y = X $ \
echo N ; @ ] 2 e ^( u U + y 7 v S Z k S { p x C ^& ? T c 3
echo K 1 z ^& a F n 0 ' H m v F ; . b k b g o V ^|
echo " F ( d k { - I r # D T ( ; T N 3 { G Q * H
pause >nul
color 07
exit /b
:M3
title Animation Box - Matrix part 2 - shaun@hacktop: scrot -c -d 3
mode con cols=89 lines=33
color 0a
echo ÃÃ[shaun@hacktop][~]
echo ÃÃþ packer -Syu
echo Password:
echo :: Synchronizing package databases...
echo core is up to date
echo extra is up to date
echo community is up to date
echo :: Starting full system upgrade...
echo local database is up to date
echo :: Synchronizing aur database...
echo aur 6 6 [#############################] 100%%
echo :: Starting full aur upgrade...
echo local database is up to date
echo ÃÃ[shaun@hacktop][~]
echo ÃÃþ uptime
echo 03:16:23 up 5:10, 1 user, load average: 0.02, 0.08, 0.08
echo ÃÃ[shaun@hacktop][~]
echo ÃÃþ acpi
echo Battery 0: Full, 100%%
echo ÃÃ[shaun@hacktop][~]
echo ÃÃþ uname -a
echo Linux hacktop 2.6.32-ARCH #1 SMP REEMPT Tue Feb 9 14:46:08 UTC 2010 i686 Intel(R) Pentium(R) M processor 1.73GHz Genuine Intel GNU /Linux
echo ÃÃ[shaun@hacktop][~]
echo ÃÃþ scrot -c -d 3
echo Taking shot in 3.. 2.. 1.. Ã
pause >nul
color 07
exit /b
:M4
title Animation Box - Matrix part 2 - shaun@hacktop: ~
mode con cols=89 lines=33
color 0a
echo ÃÃ[shaun@hacktop][~]
echo ÃÃþ archey
echo.
echo +
echo # OS: Arch Linux i686
echo ### Hostname: hacktop
echo ##### Kernel: 2.6.32-ARCH
echo ####### Uptime: 5:10
echo ;#######; Window Manager: wmii
echo ######### Desktop Environment: None found
echo ########### Packaged: 364
echo ############# RAM: 274 MB / 2017 MB
echo ############### CPU: Intel(R) Pentium(R) M Processor 1,73 GHz
echo ####### ####### Shell: Zsh
echo .######; ;######. Root FS: 1.9G / 70G (ext3)
echo .#######; ;#######.
echo #########. .#########
echo ######' '######
echo ;#### ####;
echo ##' '##
echo #' '#
echo.
echo ÃÃ[shaun@hacktop][~]
echo ÃÃþ []
pause >nul
color 07
exit /b
:: Reset variables from all animations to prevent missexecution
:: "exit /b" quits the last used CALL-command
:ResetVariables
set choice=
set Color=
set Counter=0
set Height=
set Length=
set Line=
FOR /L %%A IN (1,1,25) DO set Line%%A=
set Schalter=2
set Weight=
exit /b
Reply 8 years ago on Introduction
Thoughts?
Reply 5 years ago
my computer won't understand it
5 years ago on Step 2
This is not advanced, this is basic!
check this:
@setlocal enableextensions enabledelayedexpansion
@echo off
color 17
title Movement 2 ~ Grid
cls
goto data
:data
set lespa=
set rispa=
set space=5
set err=0
set right=10
set left=10
:hud
cls
echo Move your character (X) with the WASD keys. Press R to reset
echo #######################
if %space% equ 0 if %err% neq 1 (
echo #%lespa%X%rispa%#
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # # )
if %space% equ 1 if %err% neq 1 (
echo # #
echo #%lespa%X%rispa%#
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # # )
if %space% equ 2 if %err% neq 1 (
echo # #
echo # #
echo #%lespa%X%rispa%#
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # # )
if %space% equ 3 if %err% neq 1 (
echo # #
echo # #
echo # #
echo #%lespa%X%rispa%#
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # # )
if %space% equ 4 if %err% neq 1 (
echo # #
echo # #
echo # #
echo # #
echo #%lespa%X%rispa%#
echo # #
echo # #
echo # #
echo # #
echo # #
echo # # )
if %space% equ 5 if %err% neq 1 (
echo # #
echo # #
echo # #
echo # #
echo # #
echo #%lespa%X%rispa%#
echo # #
echo # #
echo # #
echo # #
echo # # )
if %space% equ 6 if %err% neq 1 (
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo #%lespa%X%rispa%#
echo # #
echo # #
echo # #
echo # # )
if %space% equ 7 if %err% neq 1 (
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo #%lespa%X%rispa%#
echo # #
echo # #
echo # # )
if %space% equ 8 if %err% neq 1 (
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo #%lespa%X%rispa%#
echo # #
echo # # )
if %space% equ 9 if %err% neq 1 (
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo #%lespa%X%rispa%#
echo # # )
if %space% equ 10 if %err% neq 1 (
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo # #
echo #%lespa%X%rispa%# )
echo #######################
echo.
echo.
choice /c wasdr /n
if %errorlevel% equ 1 goto w
if %errorlevel% equ 2 goto a
if %errorlevel% equ 3 goto s
if %errorlevel% equ 4 goto d
if %errorlevel% equ 5 goto data
:w
set /a space=%space%-1
if %space% lss 0 set space=0
goto hud
:a
set lespa=!lespa:~0,-1!
set /a left=%left%-1
if %left% lss 1 set left=1 && set lespa=%lespa%
set rispa=%rispa%
set /a right=%right%+1
if %right% gtr 19 set right=19 && set rispa=!rispa:~0,-1!
goto hud
:s
set /a space=%space%+1
if %space% gtr 10 set space=10
goto hud
:d
set rispa=!rispa:~0,-1!
set /a right=%right%-1
if %right% lss 1 set right=1 && set rispa=%rispa%
set lespa=%lespa%
set /a left=%left%+1
if %left% gtr 19 set left=19 && set lespa=!lespa:~0,-1!
goto hud
11 years ago on Step 2
^^ I think I'm the only person who got the IF's AND's or NOT's thing. "NOR" does anyone other than us know what were talking about.
Reply 5 years ago on Introduction
IF, AND, NOT is used pretty much same way as in standard english
Reply 10 years ago on Step 2
:o I think I got it too. "IF" "AND" "NOT"
Reply 10 years ago on Step 2
I GOT IT TOO!
IF you thought they were batch commands AND NOT just in regular old all caps, you got it!
5 years ago on Introduction
even easier:
@echo off
@title rainbows!
:1
color
color 01
color 10
color 12
color 21
color 23
color 32
color 34
color 43
color 45
color 54
color 56
color 65
color 67
color 76
color 78
color 87
color 89
color 98
color 9a
color a9
color ab
color ba
color bc
color cb
color de
color ed
color ef
color fe
goto 1
5 years ago on Introduction
faster, easier:
@echo off
:1
title rainbows!
color 01
title rainbows!
color 10
title rainbows!
color 12
title rainbows!
color 21
title rainbows!
color 23
title rainbows!
color 32
title rainbows!
color 34
title rainbows!
color 43
title rainbows!
color 45
title rainbows!
color 54
title rainbows!
color 56
title rainbows!
color 65
title rainbows!
color 67
title rainbows!
color 76
title rainbows!
color 78
title rainbows!
color 87
title rainbows!
color 89
title rainbows!
color 98
title rainbows!
color 9a
title rainbows!
color a9
title rainbows!
color ab
title rainbows!
color ba
title rainbows!
color bc
title rainbows!
color cb
title rainbows!
color de
title rainbows!
color ed
title rainbows!
color ef
title rainbows!
color fe
goto 1
6 years ago on Introduction
here is a super-fast rainbow code i made:
@echo off
:1
title rainbows!
color 01
goto 2
:2
title rainbows!
color 10
goto 3
:3
title rainbows!
color 12
goto 4
:4
title rainbows!
color 21
goto 5
:5
title rainbows!
color 23
goto 6
:6
title rainbows!
color 32
goto 7
:7
title rainbows!
color 34
goto 8
:8
title rainbows!
color 43
goto 9
:9
title rainbows!
color 45
goto 10
:10
title rainbows!
color 54
goto 11
:11
title rainbows!
color 56
goto 12
:12
title rainbows!
color 65
goto 13
:13
title rainbows!
color 67
goto 14
:14
title rainbows!
color 76
goto 15
:15
title rainbows!
color 78
goto 16
:16
title rainbows!
color 87
goto 17
:17
title rainbows!
color 89
goto 18
:18
title rainbows!
color 98
goto 19
:19
title rainbows!
color 9a
goto 20
:20
title rainbows!
color a9
goto 21
:21
title rainbows!
color ab
goto 22
:22
title rainbows!
color ba
goto 23
:23
title rainbows!
color bc
goto 24
:24
title rainbows!
color cb
goto 25
:25
title rainbows!
color de
goto 26
:26
title rainbows!
color ed
goto 27
:27
title rainbows!
color ef
goto 28
:28
title rainbows!
color fe
goto 1
8 years ago on Step 3
How do i make a line so then somebody could write on batch please answer
Reply 7 years ago on Introduction
You make it so the person using your program can write by doing this command
set/p input=Enter:
That will make it so they can enter their own words.
Reply 6 years ago on Introduction
yes, you can just write this command into notepad
set /p "input=what do you want to type? "
pause>nul
that's a simple code for allowing user to type something in batch file