"I do not regret one bit for not being able to know many things, but I will
very, very sorry if you do not understand a thing "
[y3dips]
BEGIN
* INTRODUCTION: This paper was made to introduce what batch file programming
, and how to create a batch file. yesterday I was not invited
learning perl, now "batch programming" .. be aware of. programming is beautiful!
Batch file programming is nothing & & no not just a batch [a] command
Commands DOS (Disk Operating System), was from here known as the
The batch. This causes Batch Programming has become so
tough (for Wind # ze Offcourse) because it gives full control
for DOS, [equivalent to * nix is a shell OPS.Syst Programing, red]
Commands used are all the commands in DOS OPS.SYS
As for the list of commands [taken from XP OPS]: for os win9xkemungkinan
not much different, to find out is to type help
at a DOS prompt.
C: \ DOCUME ~ 1 \ y3dips> help
For more information on a specific command, type HELP command-name
Assoc Displays or modifies file extension associations.
AT Schedules commands and programs to run on a computer.
Attrib Displays or changes file attributes.
BREAK Sets or clears extended CTRL + C checking.
CACLS Displays or modifies access control lists (ACLs) of files.
CALL Calls one batch program from another.
CD Displays the name of or changes the current directory.
CHCP Displays or sets the active code page number.
Chdir Displays the name of or changes the current directory.
CHKDSK Checks a disk and displays a status report.
CHKNTFS Displays or modifies the checking of disk at boot time.
CLS Clears the screen.
CMD Starts a new instance of the Windows command interpreter.
COLOR Sets the default console foreground and background colors.
COMP Compares the contents of two files or sets of files.
COMPACT Displays or alters the compression of files on NTFS partitions.
CONVERT Converts FAT volumes to NTFS. You can not convert the
current drive.
COPY Copies one or more files to another location.
DATE Displays or sets the date.
DEL Deletes one or more files.
DIR Displays a list of files and subdirectories in a directory.
DISKCOMP Compares the contents of two floppy disks.
Diskcopy Copies the contents of one floppy disk to another.
DOSKEY edits command lines, recalls Windows commands, and creates macros.
ECHO Displays messages, or turns command echoing on or off.
ENDLOCAL Ends localization of environment changes in a batch file.
ERASE Deletes one or more files.
EXIT Quits the cmd.exe program (command interpreter).
FC Compares two files or sets of files, and displays the differences
between them.
FIND Searches for a text string in a file or files.
FINDSTR Searches for strings in files.
FOR Runs a specified command for each file in a set of files.
FORMAT Formats a disk for use with Windows.
FTYPE Displays or modifies file types used in file extension associations
GOTO Directs the Windows command interpreter to a labeled line in a
batch program.
GRAFTABL enables Windows to display an extended character set in graphics
mode.
HELP Provides Help information for Windows commands.
IF Performs conditional processing in batch programs.
LABEL Creates, changes, or deletes the volume label of a disk.
MD Creates a directory.
Mkdir Creates a directory.
MODE Configures a system device.
MORE Displays output one screen at a time.
MOVE Moves one or more files from one directory to another directory.
PATH Displays or sets a search path for executable files.
PAUSE Suspends processing of a batch file and displays a message.
POPD Restores the previous value of the current directory saved by PUSHD
PRINT Prints a text file.
PROMPT Changes the Windows command prompt.
PUSHD Saves the current directory then changes it.
RD Removes a directory.
Recover recovers readable information from a bad or defective disk.
REM Records comments (remarks) in batch files or CONFIG.SYS.
REN Renames a file or files.
Rename Renames a file or files.
REPLACE Replaces files.
Rmdir Removes a directory.
SET Displays, sets, or removes Windows environment variables.
elas per-sintax/perintah, type [command] /?
example: C: \ DOCUME ~ 1 \ y3dips> echo /!
it would appear
Displays messages, or turns command-echoing on or off.
ECHO [ON | OFF]
ECHO [message]
ECHO type without parameters to display the current echo setting.
please try to learn one by one:)
* PRE Programing
Let's type in the console / command wind # ws promptnya using
command / sintax ECHO
which serves to display a message, just like printf in C & & perl
Now we will show the text Hello world: P
C: \ DOCUME ~ 1 \ y3dips> echo hello world
The resulting output is
hallo world
use the command / sintax that can be used; please try.
* Programing
If we had typed in the console / command prompt on windows and now
we'll programming by using the editor [let cool slightly]
what we need?
1. notepad
2. editor at the Dos prompt [edit.exe, I'll wear ginian easy,: p]
3. your favorite editor ..
* save the file with the name of free berekstension BAT: ex [name]. BAT
further to our discussion use the DOS let edit.exe easy:)
* START Programing
+ + use of ECHO
now we do like the above, ie print "HALLO WORLD"
open from the command prompt edit.exe
C: \ DOCUME ~ 1 \ y3dips> edit
will display an editor,
type the command: ECHO hallo world
and save the name hallo.bat
run from the command prompt
C: \ DOCUME ~ 1 \ y3dips> hallo.bat
then the output will appear:
C: \ DOCUME ~ 1 \ y3dips> echo hello world
hallo world
hmm. echo seen in the show!, therefore we
add @ in front of the command, @ ECHO
C: \ DOCUME ~ 1 \ y3dips> auedit hallo.bat
add @ to become @ echo hello world
save and execute files hallo.bat, what is obtained
C: \ DOCUME ~ 1 \ y3dips> hallo.bat
hallo world
:) More sweet is not it? without any visible echo, wah tired of typing "@" and hold in front of the echo command, for that use the @ ECHO OFF
will turn off all display kelayar echo, so that will not echo sintax
come shown,
we try:)
C: \ DOCUME ~ 1 \ y3dips> edit hallo.bat
@ echo off
echo hello world
echo eat ah
echo study continues
echo maen dunk!
save and run, it will produce the following output
C: \ DOCUME ~ 1 \ y3dips> hallo.bat
hallo world
eat ah
learning continues
play dong!
not fun, hehehhehe:): P
+ + use of CLS
we see helpnya
C: \ DOCUME ~ 1 \ y3dips> CLS /?
results:
C: \ DOCUME ~ 1 \ y3dips> cls /?
Clears the screen.
CLS
execute: C: \ DOCUME ~ 1 \ y3dips> gantinama.bat
generated if there hallo.txt files, are:
file exists
----- -------- process
replacement work
:) Cool not ...
+ + The use of ERASE: P
C: \ DOCUME ~ 1 \ y3dips> edit hapus.bat
@ ERASE hello.txt
hello.txt been destroyed ..
27.1.10
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment