[K12OSN] Way off topic - Windows batch file question

Doug Simpson simpsond at leopards.k12.ar.us
Fri Jul 8 14:31:18 UTC 2005

Here is a way I would try to do it. . .
Place a file in the root of the backup drive(s) called query.txt or 
something you'll remember.

>>>batchfile up to here<<<

if exist h:\query.txt goto continueh
if exist I:\query.txt goto continuei
if not exist h:\query.txt goto error
if not exist I:\query.txt goto error

>>>>do the backup with appropriate drive letter for H:<<<<
copy <path to a copy of>\query.txt h:\ /y
goto end

>>>>do the backup with appropriate drive letter for I:<<<<
copy <path to a copy of>\query.txt i: /y
goto end

echo There was an error finding your backup drive.
echo Make sure it is connected and turned on and try again.
echo I'll wait for you to do that or press (CTRL-C) to cancel.
echo When your drives are ready,

goto start


echo DONE!

There may be other ways, but this will work.  Only thing you have to 
remember is that if you change the backup routines, you will need to make 
the same changes in both the H and the I sections.

This will look for the file called query.txt on H and if it finds it, will 
start the backup, and copy the file query.txt to the root of the H: drive.
If the file doesn't exist (there is no H: drive) it will run the next line 
which runs the batch section for the I: drive.

Hope this helps at least a little. . .

Doug Simpson
Technology Specialist
DeQueen Public Schools
DeQueen, AR 71832
simpsond at leopards.k12.ar.us
Tux for President!

On Fri, 8 Jul 2005, Jim Kronebusch wrote:

> Sorry for the nature of this post, but I think there are Windows wizards
> out here as well.
> I have a Win2000 server and a pair of Iomega 160GB usb hard drives.  I
> need to back up to these drives.  I can set whatever backup program to
> back up to drive x:.  I need to be able to swap these drives weekly and
> take one off site.  Problem is when I plug in one drive it assigns drive
> h: to it, the other gets i: assigned to it.  This causes my backup
> program to get stupid.
> I am thinking I can solve this by placing a simple batch file in the
> Windows scheduler that deletes drive x:, runs a quick check for which
> drive is available h: or i:, then has an if statement duplicate h: to x:
> if h: exists, if h: doesn't exist and i: does exist the duplicate i: to
> x:.
> Does this make any sense?  This just seems like it could save a lot of
> money on tape drives if it is figured out.
> Thanks
> Jim Kronebusch
> Cotter Tech Department
> 507-453-5188
> jim at winonacotter.org 
> -- 
> This message has been scanned for viruses and
> dangerous content by the Cotter Technology 
> Department, and is believed to be clean.
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>

More information about the K12OSN mailing list