Hello World!
Hvad er hello World?
Hello World er for de fleste det første program man ser virke.
Det er en term som betegner, at man har bevæget sig ind i en verden hvor
mulighederne er uendelige. ..
Nedenstående batch program kan du kopierer over i et tekst dokument, og så omdøbe til helloworld.bat
@ECHO OFF
Echo Hello World!
@echo:
Echo Du har lige lavet dit f0rste program
Echo Du er nu en programm0r...
@echo:
Echo **********************
Echo ***** TILLYKKE *****
Echo **********************
Pause
Exit
Leg med tid og farver:
@echo off
REM Sær farve
color 1f
REM Skriv tiden på skærmen
echo Klokken er nu: %time%
REM Vent 3 sekunder
ping localhost -n 3 >nul
REM Skift farve på skærmen
color 1e
REM Skriv tiden på skærmen
echo Klokken er nu: %time%
REM vent på at bruger aktion
pause
exit
Prøv dette lille talspil:
@echo off
REM *********************************************************
REM Det er kun i REM du kan benytte danske tegn som æøå
REM i selve koden kan danske tegn ikke benyttes, kun engelske
REM *********************************************************
color 2f
echo Spillet startes.....vent......
:A
REM Vent 1 sekund
ping localhost -n 3 >nul
REM * Slet skærm
cls
REM * Sæt farven til sort/gul
color 0e
REM * Titlen på winduet
title Tal spil
set /a guessnum=0
REM set /a answer=%RANDOM%
REM sæt nummer mellem 0-100
set /a answer=%RANDOM% %%100
set variable1=nuddy24
echo -------------------------------------------------
echo Velkommen til Talpillet!
echo.
echo Pr0v at gaette mit nummer!
echo -------------------------------------------------
echo.
:top
echo.
set /p guess=
echo.
if %guess% GTR %answer% ECHO Lavere!
if %guess% LSS %answer% ECHO H0jere!
if %guess%==%answer% GOTO EQUAL
set /a guessnum=%guessnum% +1
if %guess%==%variable1% ECHO Du fandt bagd0ren i spillet?, svaret er: %answer%
goto top
:equal
echo Tillykke, Du gaettede rigtigt!!!
pause
echo.
echo Du brugte %guessnum% gaet.
echo.
ping localhost -n 1 >nul
cls
echo -------------------------------------------------
set /p input= Vil du pr0ve igen ? -
echo -------------------------------------------------
REM * Vi prøver at ramme alle mulige svar
if %input%==j goto A
if %input%==ja goto A
if %input%==Ja goto A
if %input%==JA goto A
if %input%==no goto B
Et lille animations program:
@echo off
color 0a
title Smiley faces
:note
ping localhost -n 2 >nul
pause
goto main
:main
cls
color 6E
echo __ooooooooo__
echo oOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOO* *OOOOOOOOOOOOOO* *OOOOOOOOOOOOo
echo oOOOOOOOOOOO OOOOOOOOOOOO OOOOOOOOOOOOo
echo oOOOOOOOOOOOOo oOOOOOOOOOOOOOOo oOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOo
echo oOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOo
echo *OOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO*
echo *OOOOOO *OOOOOOOOOOOOOOOOOOOOOOOOOOOOO* OOOOOO*
echo *OOOOOO *OOOOOOOOOOOOOOOOOOOOOOOOOOO* OOOOOO*
echo *OOOOOOo *OOOOOOOOOOOOOOOOOOOOOOO* oOOOOOO*
echo *OOOOOOOo *OOOOOOOOOOOOOOOOO* oOOOOOOO*
echo *OOOOOOOOo *OOOOOOOOOOO* oOOOOOOOO*
echo *OOOOOOOOo oOOOOOOOO*
echo *OOOOOOOOOOOOOOOOOOOOO*
echo ""ooooooooo""
ping localhost -n 2 >nul
goto start
:start
cls
color 6E
REM color 7F
echo __ooooooooo__
echo oooo$$$$$$$$$$$$oooo
echo oo$$$$$$$$$$$$$$$$$$$$$$$$o
echo oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o o$ $$ o$
echo o $ oo o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o $$ $$ $$o$
echo oo $ $ "$ o$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$o $$$o$$o$
echo "$$$$$$o$ o$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$o $$$$$$$$
echo $$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$
echo $$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$$$$$$ """$$$
echo "$$$""""$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$
echo $$$ o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$o
echo o$$" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$o
echo $$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$ooooo$$$$o
echo o$$$oooo$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ o$$$$$$$$$$$$$$$$$
echo $$$$$$$$"$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$""""""""
echo """" $$$$ "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" o$$$
echo "$$$o """$$$$$$$$$$$$$$$$$$"$$" $$$
echo $$$o "$$""$$$$$$"""" o$$$
echo $$$$o o$$$"
echo "$$$$o o$$$$$$o"$$$$o o$$$$
echo "$$$$$oo ""$$$$o$$$$$o o$$$$""
echo ""$$$$$oooo "$$$o$$$$$$$$$"""
echo ""$$$$$$$oo $$$$$$$$$$
echo """"$$$$$$$$$$$
echo $$$$$$$$$$$$
echo $$$$$$$$$$"
echo "$$$""
ping localhost -n 2 >nul
goto a
:a
cls
:a
color 19
echo __ooooooooo__
echo oOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOO* *OOOOOOOOOOOOOO* *OOOOOOOOOOOOo
echo oOOOOOOOOOOO OOOOOOOOOOOO OOOOOOOOOOOOo
echo oOOOOOOOOOOOOo oOOOOOOOOOOOOOOo oOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOo
echo oOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOo
echo *OOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO*
echo *OOOOOO *OOOOOOOOOOOOOOOOOOOOOOOOOOOOO* OOOOOO*
echo *OOOOOO *OOOOOOOOOOOOOOOOOOOOOOOOOOO* OOOOOO*
echo *OOOOOOo *OOOOOOOOOOOOOOOOOOOOOOO* oOOOOOO*
echo *OOOOOOOo *OOOOOOOOOOOOOOOOO* oOOOOOOO*
echo *OOOOOOOOo *OOOOOOOOOOO* oOOOOOOOO*
echo *OOOOOOOOo oOOOOOOOO*
echo *OOOOOOOOOOOOOOOOOOOOO*
echo ""ooooooooo""
ping localhost -n 2 >nul
goto main
pause
goto main
:main
cls
color 6E
echo __ooooooooo__
echo oooo$$$$$$$$$$$$oooo
echo oo$$$$$$$$$$$$$$$$$$$$$$$$o
echo oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o o$ $$ o$
echo o $ oo o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o $$ $$ $$o$
echo oo $ $ "$ o$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$o $$$o$$o$
echo "$$$$$$o$ o$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$o $$$$$$$$
echo $$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$
echo $$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$$$$$$ """$$$
echo "$$$""""$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$
echo $$$ o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$o
echo o$$" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$o
echo $$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$ooooo$$$$o
echo o$$$oooo$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ o$$$$$$$$$$$$$$$$$
echo $$$$$$$$"$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$""""""""
echo """" $$$$ "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" o$$$
echo "$$$o """$$$$$$$$$$$$$$$$$$"$$" $$$
echo $$$o "$$""$$$$$$"""" o$$$
echo $$$$o o$$$"
echo "$$$$o o$$$$$$o"$$$$o o$$$$
echo "$$$$$oo ""$$$$o$$$$$o o$$$$""
echo ""$$$$$oooo "$$$o$$$$$$$$$"""
echo ""$$$$$$$oo $$$$$$$$$$
echo """"$$$$$$$$$$$
echo $$$$$$$$$$$$
echo $$$$$$$$$$"
echo "$$$""
ping localhost -n 2 >nul
goto start
:start
cls
color 7F
echo __ooooooooo__
echo oOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOOOOOOOOO* *OOOOOOOOOOOOOO* *OOOOOOOOOOOOo
echo oOOOOOOOOOOO OOOOOOOOOOOO OOOOOOOOOOOOo
echo oOOOOOOOOOOOOo oOOOOOOOOOOOOOOo oOOOOOOOOOOOOOo
echo oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo
echo oOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOo
echo oOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOo
echo *OOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO*
echo *OOOOOO *OOOOOOOOOOOOOOOOOOOOOOOOOOOOO* OOOOOO*
echo *OOOOOO *OOOOOOOOOOOOOOOOOOOOOOOOOOO* OOOOOO*
echo *OOOOOOo *OOOOOOOOOOOOOOOOOOOOOOO* oOOOOOO*
echo *OOOOOOOo *OOOOOOOOOOOOOOOOO* oOOOOOOO*
echo *OOOOOOOOo *OOOOOOOOOOO* oOOOOOOOO*
echo *OOOOOOOOo oOOOOOOOO*
echo *OOOOOOOOOOOOOOOOOOOOO*
echo ""ooooooooo""
ping localhost -n 2 >nul
goto a
:a
cls
color 19
echo __ooooooooo__
echo oooo$$$$$$$$$$$$oooo
echo oo$$$$$$$$$$$$$$$$$$$$$$$$o
echo oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o o$ $$ o$
echo o $ oo o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o $$ $$ $$o$
echo oo $ $ "$ o$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$o $$$o$$o$
echo "$$$$$$o$ o$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$o $$$$$$$$
echo $$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$
echo $$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$$$$$$ """$$$
echo "$$$""""$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$
echo $$$ o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$o
echo o$$" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$o
echo $$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$ooooo$$$$o
echo o$$$oooo$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ o$$$$$$$$$$$$$$$$$
echo $$$$$$$$"$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$""""""""
echo """" $$$$ "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" o$$$
echo "$$$o """$$$$$$$$$$$$$$$$$$"$$" $$$
echo $$$o "$$""$$$$$$"""" o$$$
echo $$$$o o$$$"
echo "$$$$o o$$$$$$o"$$$$o o$$$$
echo "$$$$$oo ""$$$$o$$$$$o o$$$$""
echo ""$$$$$oooo "$$$o$$$$$$$$$"""
echo ""$$$$$$$oo $$$$$$$$$$
echo """"$$$$$$$$$$$
echo $$$$$$$$$$$$
echo $$$$$$$$$$"
echo "$$$""
ping localhost -n 2 >nul
goto main