home *** CD-ROM | disk | FTP | other *** search
- @echo off
-
- ::**********************************************************************
- :: Demonstrates using a batch file to script GetRight.
- :: Shows saving older copies of the file being repeatedly downloaded.
- ::
- :: You must use START /W if you use the /W parameter in GetRight so
- :: that a Windows DOS prompt will really wait until everything finishes
- :: to continue with the batch file.
- ::**********************************************************************
-
- ::*** See if the file already exists.
- ::*** Uses the fact that GetRight adds .GetRight to the name until the file is done.
- if not exist c:\backup.bck goto DOWNLOAD_IT
-
- ::*** Does exist, so get rid of oldest and move other copies back before re-downloading.
- del c:\backup.bck.5
- ren c:\backup.bck.4 c:\backup.bck.5
- ren c:\backup.bck.3 c:\backup.bck.4
- ren c:\backup.bck.2 c:\backup.bck.3
- ren c:\backup.bck.1 c:\backup.bck.2
- ren c:\backup.bck c:\backup.bck.1
-
-
- :DOWNLOAD_IT
- ::*** Download the file...
- start /w GETRIGHT.EXE /url:"ftp://www.xyz.com/backup.bck" /file:"c:\backup.bck" /w
-
-
- ::*** Check if file exists to give OK or fail msg.
- if exist c:\backup.bck goto DONE_DOWNLOAD
- echo ERROR: Download Failed!
- goto EXIT
- :DONE_DOWNLOAD
- echo Downloaded OK!
-
-
- :EXIT