 |
|
a batch file is a executable ms-dos file that runs what commands are in it. works in ms-dos based systems.. windows xp is very limited in this.. almost none of this will work on windows XP.. you will be able to create a batch file in 3 easy steps ...
::1st step::
open windows explorer. if you dont know what that is click start, goto run, type explorer. your inside windows explorer.
click view at the top of it, then click folder options. click the view tab, where it says hide file extensions, make sure thats unselected.. then click ok..
::2nd step::
right click on desktop. goto new.. click new text document.. a file will appear on desktop.. ( New Text Document.txt ) rename it to ( myfile.bat )..
::3rd step::
it is time to learn dos commands to use in your batch file.. right click on the myfile.bat you created and click edit notepad should open and be blank.. i will list some of the commands and what they do.. just insert into notepad and save notepad then run the batch file
cd - change directory
*exsample* c:/cd windows = c:/windows
cd.. - go back a directory
*exsample* c:/windows/cd.. = c:/
echo - echo displays a message..
*exsample* echo hi = c:/hi
echo off/on - echo off turns off the c:/ prompt
*exsample* C:/batch/echo off =
cls - this clears the screen of what was displayed..
dir - this lists the files and folders in the directory
mkdir - this creates a folder..
*exsample* mkdir batch (folder batch created)
deltree - deltree deletes a file or folder
*exsample* deltree c:/batch
pause - pauses the batch intill a key is pressed
call - this calls another file to run. when finished batch starts back up.
rename - use this to rename files or folders
*exsample* rename c:/batch batch2
copy - this copys files to another location
*exsample* copy *.* c:/batch
xcopy - if copy dont work try this one
*exsample* xcopy *.* c:/batch
format - this formats a drive or disk..
*danger* will erase all files on your computer
goto - use this to goto a label
*exsample* goto mylabel :mylabel
edit - use this to edit files on your computer
*exsample* edit c:/docs/file.txt
choice - you use choice for the user to enter a value to direct to a label
*exsample*
:top
echo want to goto the top? or bottom?
echo 1=Top 2=Bottom
choice /c:12
if errorlevel 2 goto bottom
if errorlevel 1 goto top
:bottom
here is a site too learn all the dos commands, to use in your batch files.
and it explains what they do and all the options they have..
to see the help file on a command to get more options, for instance like
format and deltree. you can put deltree /y c:/ it will automaticly delete
files without prompting or format /y c: same thing. all you have to do is
goto dos prompt. click start goto run and type command. and it will
take you to command prompt. or in windows xp type cmd. and just type
command/? to get the help file on it. like format/? will display formats
help file.
if you would like to see a sample run of this stuff download this. it is my
batch file i made that will teach you to make batch files as well..
and you can also test these dos commands on dos prompt. goto start,
click run and type command. (cmd) on windows xp.
and if you would like to see the power of a batch file, at its finest down-
load my directory organizer to a directory with tons of mixed file extent-
ions like exe, zip, txt, wav, mp3. then click organize. and boom the whole
directory is sorted neatly..
|

|