home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 October / CHIP Turkiye Ekim 2000.iso / prog / basic / 07 / setup.exe / %MAINDIR% / sample.bat < prev    next >
Encoding:
DOS Batch File  |  2000-05-02  |  1.0 KB  |  35 lines

  1.   @echo off
  2.  
  3. ::**********************************************************************
  4. :: Demonstrates using a batch file to script GetRight.
  5. :: Shows checking to see if file exists, dialing, downloading, hanging up.
  6. ::
  7. :: You must use START /W if you use the /W parameter in GetRight so
  8. :: that a Windows DOS prompt will really wait until everything finishes 
  9. :: to continue with the batch file.
  10. ::**********************************************************************
  11.  
  12. ::*** See if the file already exists.
  13. ::*** Uses the fact that GetRight adds .GetRight to the name until the file is done.
  14. if exist c:\junk.html goto EXIT
  15.  
  16.  
  17. ::*** Dial the modem...
  18. start /w GETRIGHT.EXE /dial /w
  19.  
  20. ::*** Download the file...
  21. start /w GETRIGHT.EXE /url:"http://www.getright.com/index.html" /file:"c:\junk.html" /w
  22.  
  23. ::*** Hangup the modem...
  24. GETRIGHT.EXE /hangup
  25.  
  26.  
  27. ::*** Check if file exists to give OK or fail msg.
  28. if exist c:\junk.html goto DONE_DOWNLOAD
  29.   echo ERROR:  Download Failed!
  30.   goto EXIT
  31. :DONE_DOWNLOAD
  32.   echo Downloaded OK!
  33.  
  34.  
  35. :EXIT