0% found this document useful (0 votes)
76 views

Bat File Programming

The document discusses different commands that can be used in batch files. It explains what batch files are and provides examples of using echo, pause, cls, msg and start commands in batch files to display messages, clear the screen, send messages and open files. The document also covers basics of conditional statements like if and goto.

Uploaded by

Pyae Sone
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

Bat File Programming

The document discusses different commands that can be used in batch files. It explains what batch files are and provides examples of using echo, pause, cls, msg and start commands in batch files to display messages, clear the screen, send messages and open files. The document also covers basics of conditional statements like if and goto.

Uploaded by

Pyae Sone
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

www.kmdstudents.wall.lm rapperlay444[gmall.

com
oot..oqoo5 post oogto5o _o5o_o..ooqoo5 ogt_oo5..Documentation o_ot_o
ooo5 5toqo5..ot.:D ooco ogto5ooo5 Bat File ooo_o5cto. Bat files
ooo_o5ct o ooc ooo5oc_oo ocoocto5tooo...oqoo5 oO5too
o ooqcot gct_oo5to5o..q5too_gco oqoo5o oooco5ooto
gooo..ooqcot gct_oo5to5o..oqoo5o o oo5oo5oo o_oqoqt KND
o5 !DCS oooqooo.. !DCS-3+ oo..:) oqoo5o ooooocgcoo5
[email protected] o add ooo.oqoo5o 5toto
ocooooo..o..intro ocoqo5 qq_o5o5t_o.coo_ogo5c. :P
Bat File ocoqtc5 o (Basic Level)
o_oo ocooq coogo5coq5. q5too_gc o oqoo5o
_oqootqcooo ..q5to_oooo..q5too_ooo comment oooot_ot
_oqgct_oooooq5.oqoo5ooocoo c5ogto5o ooq5 oooo c5ogtog5
oooo c5oooo oooo5c _ocgc ocoooot o..:)
oc_ot ootoat_o_ootooo
bat o5 oocoo5totq o_oo ootootooo c_otootoat_o_go5c
o_oooot command g oooo5
(o) echo
(_) @echo offfon q
(g) pause co5ooo_ocooo
www.kmdstudents.wall.lm rapperlay444[gmall.com
oOootoqq _oo5oot ocoogt_o_ooo
@echo off
echo Hello, Welcome to www.kmdstudents.wall.fm
pause
oooto oct_otot Windows Tool oco_oco notepad o5 ogt_otoo5 test1.bat
o_otootooo :P
_otgcoo5 Run ooo oog5c Screen Oo5 o5oo5 _oO5tooct
oo`o5oooo..:)
oqo _oo5ooto5 echo off c5t echo on ot_otoo5 o5o5tOt_o5toooo5 o5oo
Code ootocotogt_o_go5c
@echo on
echo Hello, Welcome to www.kmdstudents.wall.fm
pause
_otgcoo5 oqooct notepad o5 ogt_ot test2.bat o_otoot_ot _oq Run ooo.
o5oo5 _oO5to oct _ocgooooo
www.kmdstudents.wall.lm rapperlay444[gmall.com
o_ocgooooo C:)Documents and Setting). co5ooooo5 ocO5to Windows .
File oc_tooooo`oo__ot o_o5tooooo
o oo`o5 oqoogtO5to Code ootooo gct_oootooo
oqoo5o oooogtooo code o5ogc @echo on ootooo oo File
O5tg5ooto_o5cto Program Code oco Run octo5_ooqooo
oooo5t oOoccocto5 ogtoo @echo off o otO5tooogcoo5 o_o_
ooto_o5ctooooo`ocoq ooooco c5o5to gctoctc5oo`oco5_ocooo
oo_o_oct5t_oc @echo on q off g _o5tq5tooo oqc_otoo5 @echo off o
oto5 ooo5ctoooo5o q5to_o5tooOcooo
oq5oococoqq echo o_o5ctgct_oooo
ooq5oo5 gtgt c5o_o5ctoco_o5ctoo5o o Program Run oqt_oocooogc
(_oo5 oqo Program Ooo Hello, Welcome to www.kmdstudents.wall.fm" oo
simple phrase ocooo5ooo _oocooogcoo5 echo o oo5_oococ5o5togo5
O5t_otogtqcooo.
o pause o_o5ctgct_oootooo
pause oo5ooo5 goo5o (oooo5 octo_o5oo5t o_otoo5 oo_o5ooqoq5..:P)
batch file o run oqgctq oq5tocgc pause o otooo oootgc batch file o
ooq5o oo key ocoo oaoooct ooooooo5oot key
www.kmdstudents.wall.lm rapperlay444[gmall.com
ocooaoooooogcoo5 ooocg5go5ooooo5tooooo oqo Program _
oo5 ogcoo5 pause _otoo5 o5o oooogtO5to o5ooo ooooo5 oooo
program ooq Ooo5to5_ocooo
pause o Oooq5to_oco o5oo _oo5ooto ooo5_o_ooo
@echo off
echo Hello Welcome to KND Computer Centres
pause
echo ! am testing pause function
pause
oo oo`o _oo5oo oct Save _ot Run gcoo5 o_ooctoo5_oooooo
o Program ooto cot_otgcoo5 pause o q5to_o5too5o_oOcooo
ooq5oOo q_tq_t oc_oco Command ooo ooo5_o_go5c
msg q cls o_o5cto gcooo5_o_ooo
gcoct _oo5ootooq ooo5_o_go5c
Notepad o _oqoc_otoo5 o5oo Code ootooo goO__o_ooo..
www.kmdstudents.wall.lm rapperlay444[gmall.com
@echo off
echo Hello ! am Zin Ko Oo
pause
cls
echo ! am testing cls and msg commands
msg * Bye Bye. See you online. Ny mail is [email protected]
pause
_otgcoo5 test3.bat q oot_ot Run ooo
o o_oooo5 o5oooct_ocooooo
(oooo.. .. ooqg5 og5oo oooo5t ooq5oo5 oo_o5o oct key ocooo
aoooooogc program o cls oo command g ooo ooooo5 _ocooo
o ooooogcoo5 oqo oo`oo Hello ! am Zin Ko Oo oo5_oto
oo5oo5to5_ocooo
_otgc cls g o5oo echo oo command oo ooooooooo.key ocooo
aoooooo ooo5O5t_ot oo_o__ogo5c..oogcoo5 o5oo5 _oO5to
oct_ocoqo_o.
www.kmdstudents.wall.lm rapperlay444[gmall.com
(oc5oo`_oto5q message box ocooo5ooooo)
q5to_ooo5too5ooot..oqoo5ooo5 ooqcot oo5gct_oO5to5o.
ooo5 cls q msg o oooq5to_ooooo ..
co . co o oooq5to_ooo5ooot . oqoo5o_o5_ooco5ooo5
-cls oo5g g_oo5oo Clear Screen o (ocoocto o_oo5o..:P .
oqo_o5ocotgcoo5c oooo) oo Screen o5go c5o5tooo gctOo
(ooOo) ootgooooo
-msg oo5ooo5 Nessage g ooo5o_oc_otoo5 oo User o Nessage Box
ocooooto5_ocooo GU! ootqoo.
oq5oOo Command oo o_o5ctooooo5oogo5c..
oocogct_ooco5ooo5 rem q start oo5ootooo.
oooo cotooo Folder ocoo Test oo q5o_q oo5oooto.
_otgc oOo co_o_o oocoO__otoo5 testpic oo q5o_ootooo.
www.kmdstudents.wall.lm rapperlay444[gmall.com
oq5oococoqq Notepad o oc_ot o5oo5go Coding ooo goO_ooto.
@echo off
echo We are testing start and rem
rem title Test+
start testpic.jpg
pause
_otgcoo5 test+.bat o_ot oqo Test oo Folder Oo5 save _ot Run ooo. o5oo5
_oO5to oct_ocgooooo
(key ocoo Ooaooogc oqo co_o_oogt_otoo5 O_O5to testpic.jpg o
_ocgo5o og extension ooo5 ogtoooooo`oo__ot .png . .gif . .jpg
co__ocoooooo )
oogcoo5 oo`o Program o q5to__oOcooo
-start oo5ooo5 co_o_o file ocoo oo` run ooto5_ocooo ooq5oo5 o5o
oooq start otoq ogtoogcoo5 oq5oOo o_tog5c screen oo`o5o5_ocooo
-rem oo5o ooooo5 remark o oo`o5o. ooooo oo bat file run oqoqto5
o_ocgoooot. (oooq_ocgo_too5 oqoo5o_tooot oocgcoo5
g5oo_ooooq5 _otgcoqoo5oo _oqo_o5_ooq5..:P)
o goto . set q if o gctooo5oo.
www.kmdstudents.wall.lm rapperlay444[gmall.com
oocooo5ooooo oocto q_tq_tc_otoo5 goo5o5_ocoooo5oot
oooo_o_ococooo
o5oo5ootO5to Code ooo Notepad Oo5 goO_ooo.
@echo off
echo This is a testing program
echo !f you want to see 2+2, type 1 and press enter
echo !f you want to see a picture, type 2 and press enter
set fp option=
if `option'=='1' goto :math
if `option'=='2' start testpic.jpg
:math
echo 2+2
pause
_otgcoo5 oqo Folder Oo5o test5.bat o_ot save _otgc Run ooo
Run oogcoo5 o5oo5 _oO5to oct_oooooo.
(ooco og5ogcoo5 1 q 2 qcoOo _o_og5ocoo ogtqcooo )
www.kmdstudents.wall.lm rapperlay444[gmall.com
(o oogtooogcoo5 o5oo 2+2 oo5o _oootooooo)
(_ o ogtoooogcoo5 O_O5to co_o_ooootOoo5ooooo.)
(_otgcoo5 Otcoct Press any ... oo5 )
oo`ogo5o o_oo _o_o _otgc ogct coding o _oq_o__o_o.
goto g oooooo q5to_o5ooooo goto oo5ooo5 Coding Oo5ooo
q5o_ocoootO5to program octootocooo _qtocgcotooo
(_o5t Programming Language oqq ogc Function oo Procedure ooo oo`o
ooooooof ocoocto ocot._o5toto5o.. Procedure call o5oo..:P)
oo`o Program Oo5ogc ooq5oo5 :Nath oo5o otoo5ooo5o.
o Nath o5oo5 ogtO5to o5oo5toto5 Nath q oco5oo_ocooo
oogc goto :Nath o_otogtooo oo5oo5 Program g oooo_octooo5
Nath oo og5oo5t_ot Nath g ocooo oooo5cooooo ooo5oo goto
o_o5ctooo5o_oOcooo
(ooootgc o_t _oqoooo. q5too_gcoo5 o_o5toocomment
oot_otootoooq5.oqoo5 g_octogo ooo5oooo5o
q5to_o5coogtqco5oo_t ooooooo :P)
oqo Coding o5oo set q if go_o5ctcgctooo5oo
oo _ oo og5_otgcto5 _ocooo. q5to_o5c ooo5ooootooq5...:)
set oo5ooo5 ocooo ooooo5o
www.kmdstudents.wall.lm rapperlay444[gmall.com
oo ogtgoo ooo Syntax ooo5
set variable=[string| _ocooo
ooooo !f q ootoco oo_to o5oo5 set X co__oc X ocoto_to variable
o_o_c5oogooo o o_o_c5oooogcoo5 X Oo _o_oo variable
oco5ocgooo
Set o_o5ctoocgcoo5 Run>>cmd>>set f? o_otgoO_ooo.. _otgcoo5
ooo5ooooooqcooo
oqo Program o _oqooooo.
ooq5 o oqo Code Oo5 set fp option= o_otoo5 ogtoooo
oo set choice o_otoo5 ooo_o5ct_oc_o_go5c (fp ogcgooqo5otoo..
_otoo5 oqoo5oooco ooooo5o5oooo5o o.oooooggc o
_oqgct_oootooq5.)
oo`o Program o set choice o_ot o_o5ctogtoo_oooc
oogc ooo ooq5oo5 1 o goooogc choice oo variable Oo 1
oco5tooooo
_otgcoo5 oqooo :Nath oo ooo ooooooooo
o _ocogtooo5ooto o5oo5 _oqcotogt_o_go5c
set choice
if `choice'=='1' goto :math
oogcoo5 ooo ooq5oo 1 ogoO_gc choice Oo 1 ocoo _otgcoo5
Nath oo function ooo ooooooo.(if o5oo oo5ooooo5
oqoo5oooco oooo5o oqooO5toogoc oooggco_oqgct_oootooq5 ..:D)
oo Basic octooo5 ooo ooootto ocogootoot..
www.kmdstudents.wall.lm rapperlay444[gmall.com
ooo5oogc if . set q goto o q5to_o5t_ooOcooo
ooo_o ooqO ooq5gcto5oo5toto5 oooo5 ooot
o_ooo5t_ocooo ..
Bat File ocoqtc5 _ (Advance Level)
o..oo5o5o oqo ocoqtc5g oooo.. ooo o Advance Level og5oo5t_oo
ooo5O5toooq5 .:P
o..oooq c_ot coo5ooo5oo.oooot..co_o5ooo5oo.:D
o oqoo5 oOoot co_o5oco5ooo5 call q exit o o_o5ct_ocooo
gcooooooo Notepad Oo5t_otoo5 o5oo5 go Code ooo
goO_ooo
@echo off
echo Wow.. ! am very sleepy. Now, !t's 2:30 AN.
call call.bat
pause
exit
_otgcoo5 Folder ococoo_oo5o_ot oo adv1.bat ooq5o_q ootooo
oq5ooco Notepad o _oqoco _otgc o5oo5 go Code o Oogoo
www.kmdstudents.wall.lm rapperlay444[gmall.com
@echo off
echo ! Love *You* (o post oooo oo5coootooo o_o5o5 ooootoq5..:D)
pause
_otgcoo5 oqo Save O5to adv1.bat q oo Folder Oo5 call.bat ooq5o_q Save
ooo
oq5oococoqq oOoogtO5to adv1.bat oo5o Run ooo
o5oo5 _oO5to oct Screen o5 oo`o5ooooo
oo _o_oct5t_oc exit o o5oooooooo5 oo5ooq5..
oq5oocooqq call o. call oo5ooo5 oq5oOo batch file ocoo oo`oto5o
ooo5oo call q exit o_o5ctooo5o_oOcooo
oqoo5o oo5oo oo5 o o oo5oooc_oootooo5o..ooootoooo5t
otoo oototocooo..oq5oOo post oo5ctoo5ctootoo Ooocqco5co
_o_tc5to5to5o.
5toto ococoo..
Zin Ko Oo
Edited by Foxit Reader
Copyright(C) by Foxit Software Company,2005-2006
For Evaluation Only.

You might also like