Re: dos batch programmer help!!
- From: pete@xxxxxxxxxxxxxxxxxx
- Date: Sat, 22 Jul 2006 10:08:25 +0000 (UTC)
In article <5tv2c29gdjoq9v5f1i0f7fbiqlmb393vem@xxxxxxx>
tdavis@xxxxxxxxxxxxxxxxxxxx "Ted Davis" writes:
On Fri, 21 Jul 2006 19:10:25 +0000 (UTC), pete@xxxxxxxxxxxxxxxxxx
wrote:
[ much rubbish :-( ]
vol | find "Serial"
returns the volume serial number as a string. That's what most people
seem to mean by "HD serial number". I'm pretty sure DOS 6.2 had that.
It does indeed -- I'd forgotten about VOL (and missed it in the
original post)
I would simply make the volume label indicate the day, and test for
that with a FIND command.
Alternatively [aimed at the Assaf M] try the batch below:
HBACKUP.BAT:
============
@echo off
REM Set up your two serial numbers here and ensure dir C:\TEMP\ exists
REM [test assumes the two H: drives have s/ns ABCD-1234 and ABCD-5678]
set disk1=ABCD-1234
set disk2=ABCD-5678
REM FIND returns errorlevel 0 if "text" is found, 1/2 if not found/error
:: ------------
vol h: | find "%disk1%" >nul
if errorlevel 1 goto otherdisk
REM == we found this disk s/n
type c:\temp\lastrun.txt | find "%disk1%" >nul
if errorlevel 1 goto backup_OK
echo Wrong disk(1) in H: -- swap it to allow backup to continue!
goto end
:: ------------
:otherdisk
REM == found the other disk s/n
type c:\temp\lastrun.txt | find "%disk2%" >nul
if errorlevel 1 goto backup_OK
echo Wrong disk(2) in H: -- swap it to allow backup to continue!
goto end
:: ------------
:backup_OK
REM == do your backup stuff here
echo Doing backup...
REM
REM == and update the "lastrun" file
vol h: | find "Serial" >c:\temp\lastrun.txt
:end
set disk1=
set disk2=
echo.
=============
Apologies for the bad info.
Pete
--
"We have not inherited the earth from our ancestors,
we have borrowed it from our descendants."
.
- Follow-Ups:
- Re: dos batch programmer help!!
- From: assafm
- Re: dos batch programmer help!!
- References:
- dos batch programmer help!!
- From: assafm
- Re: dos batch programmer help!!
- From: assafm
- Re: dos batch programmer help!!
- From: pete
- Re: dos batch programmer help!!
- From: Ted Davis
- dos batch programmer help!!
- Prev by Date: Re: dos batch programmer help!!
- Next by Date: Re: dos batch programmer help!!
- Previous by thread: Re: dos batch programmer help!!
- Next by thread: Re: dos batch programmer help!!
- Index(es):
Relevant Pages
|
|