Shepİ 2003
Simple Batch Files


Batch files are in effect superb little programs you can write or modify yourself to do loads of useful things.These examples are for win95/98.Batch files cannot be copyright so you can edit them how you like.The are commonly called,"Bat" files.As bat files aren't installed programs they take up no ram or window's resources.You just click on them when you want to use them.You can even pop a shortcut to them in you/Start/Programs/Startup folder if you want it to run when you boot up or drag and drop them onto your Internet Explorer Links bar as I do for ClearBat for ease of use :)

You can get two ready made really useful ones off my Free Programs Page Clear bat and SOCB(Son Of Clear Bat) for cleaning out all the windows/Internet Temp files and your computer session run history and you are welcome to edit them.To Edit a bat file once made you right click on it and choose Edit.


Copy Files bat
This has to be one of the most commonly asked for and uses for a Bat file
(But keep your folder names to less than 8 letters!!This makes it easier)

@echo off
cls
echo * * * Backup * * *
pause
copy c:\docs d:\backs\docs
copy c:\docs\cvs d:\backs\docs\cvs
ECHO Backup is complete.

The above example will copy all the folders and files from the Folder on the C:\ drive Docs folder and it's sub folder Cvs to the D:\ drive if on the D:\ drive there is a folder called Backs with sub folders Docs and a sub folder of that called Cvs.Modify the folder names and the paths to point to what you want to backup and to where.
To use/edit it just copy and paste it into notepad and save the file with any name you like say backup.bat but it must be saved with the .bat extension to work e.g backup.bat


Things to note.

1:If any of the files you are backing up have a,"Read Only" or,"System" attribute(right click on a file/properties) then once you have backed up the file once it will not be overwritten if you try to back it up again.You must remove these attributes before backing up the files but you only have to do this once.If you have a lot of files that you are backing up from a folder and they all have read only the easy quick way to strip this attribute is to Hold down the Ctrl key and the A key at the same time to highlight all the files and then right click in the blue area and choose properties and un-tick the read only attribute.If they are system files then you have to remove the attribute from pure Dos.

2:If you want to send a bat file to a friend you,"Must" zip it up otherwise it won't work when they get it.

3:After the first time you run a bat file it will make it's own shortcut.This can be used to do other things.If in the copy files example above you don't want to have to manually close it after you have used it then right click on the shortcut/properties/programs and tick the box,"Close on Exit" and that will automatically close the bat file after it's been used :)


Bat File commands Link Good link and Batch downloads

Shep's Help

| TroubleShooting | GoodHouskeeping | Home | My Songs |

| Quick Tune Up(Highly recommended) | Tips | FreePrograms |

To buy me a beer Click on the Stormpay Secure Payment icon

Sign My GuestBook View My GuestBook

Site Meter