Backup script
Batch file that makes a copy of all files found on removable devices such as floppies, USB-sticks or memory cards. It backs up to C:\backup but this destination canbe changed in the file (line 13).
This script runs under JPsoft ’s TakeCommand or 4Dos.
The current version excludes MP3’s from being copied. This behaviour can easily be modified in the /[..] clause of the COPY command (line 30).
De Listing:
@echo off
echo ***************************************************
echo.
echo Make backup copies of all inserted cards en sticks
echo (c) 2006, peter@hasperhoven.net
echo.
echo ***************************************************
// check for TakeCommand
if "%@eval[2+2]" != "4" exit
set DestDir=C:BACKUP
// for all drives
do n = %@ASCII[A] to %@ASCII[Z]
set d=%@CHAR[%n]
// only handle removable drives (floppies, cards, USB pens)
IFF %@REMOVABLE[%d:]==1 THEN
iff %@READY[%d:]==1 THEN
echo %d: is in gebruik (%@LABEL[%d:])
set label=%@LABEL[%d:]
// find the disk label if specified, if not, copy to “Drive-X” where X is driveletter
iff “%label”==”unlabeled” then
set label=Drive-%d
endiff
set Destination=%DestDir%label
MD %Destination >nul:
// don’t copy mp3’s
copy /[!*.mp3] “%d:*” “%Destination” /S /Z
else
echo %d: is empty
endiff
endiff
enddo

26 oktober 2008 at 16:50
[...] Backup script [...]