Laatste reacties
Archief
Quote of the Day
Based on what you know about him in history books, what do you think Abraham Lincoln would be doing if he were alive today?
1. Writing his memoirs of the Civil War.
2. Advising the President.
3. Desperately clawing at the inside of his coffin.

   -- David Letterman

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

download hier.

1 reactie to “Backup script”

  1. Hasperhoven . NET » Blog Archive » Backup van USB sticks en memory cards Says:

    [...] Backup script [...]

Leave a Reply