home *** CD-ROM | disk | FTP | other *** search
/ The CIA World Factbook 1992 / k3bimage.iso / sel / 10 / 0016 / sample.bat < prev    next >
Encoding:
DOS Batch File  |  1991-12-02  |  3.1 KB  |  123 lines

  1. ECHO OFF
  2. ECHO This batch file attempts to optimize drive C.  If any
  3. ECHO errors are encountered, it will attempt to fix the errors
  4. ECHO before continuing.
  5. ECHO                                    .
  6. ECHO                                    .
  7. ECHO The following command performs packed optimization for
  8. ECHO drive C:
  9. ECHO                                    .
  10. ECHO                                    .
  11.  
  12. OPTUNE C: /OP
  13.  
  14. ECHO                                    .
  15. ECHO                                    .
  16. ECHO Now, we need to test the errorlevel returned.  These codes
  17. ECHO must be tested from highest to lowest, or this batch file
  18. ECHO may not work properly.
  19. ECHO                                    .
  20. ECHO                                    .
  21.  
  22. IF ERRORLEVEL 27 GOTO USER_ABORT
  23. IF ERRORLEVEL 26 GOTO BAD_COMMAND
  24. IF ERRORLEVEL 10 GOTO DISK_CACHE
  25. IF ERRORLEVEL 8 GOTO CHECK_DISK
  26. IF ERRORLEVEL 7 GOTO NO_MEMORY
  27. IF ERRORLEVEL 6 GOTO FATAL_ERR
  28. IF ERRORLEVEL 4 GOTO NO_MEMORY
  29. IF ERRORLEVEL 3 GOTO VERIFY_DISK
  30. IF ERRORLEVEL 2 GOTO NO_DRIVE
  31. IF ERRORLEVEL 1 GOTO BAD_FAT
  32.  
  33. ECHO                                    .
  34. ECHO No problems running OPTune!!
  35. GOTO BATCH_END
  36.  
  37. :BAD_COMMAND
  38. ECHO                                    .
  39. ECHO OPTune did not understand the command it was issued.
  40. ECHO Please edit this batch file to correct the command
  41. ECHO before using it again.
  42. GOTO BATCH_PAUSE
  43.  
  44. :BAD_FAT
  45. ECHO                                    .
  46. ECHO Either the FAT or the directories are bad.  Press any key
  47. ECHO to run OPTune's Check-Disk command to try to fix
  48. ECHO them.
  49. ECHO                                    .
  50. PAUSE
  51. GOTO RUN_CHECK
  52.  
  53. :NO_DRIVE
  54. ECHO                                    .
  55. ECHO The drive you specified was not available.  Please
  56. ECHO either modify this batch file to use the correct drive,
  57. ECHO or make sure that the drive is available before using
  58. ECHO OPTune
  59. GOTO BATCH_PAUSE
  60.  
  61. :VERIFY_DISK
  62. ECHO                                    .
  63. ECHO OPTune will attempt to fix your disk problems. Press
  64. ECHO any key to run OPTune's Verify/Fix-Disk command.
  65. ECHO                                    .
  66. PAUSE
  67. \OPTUNE\OPTUNE C: /V
  68. IF ERRORLEVEL 27 GOTO USER_ABORT
  69. IF ERRORLEVEL 1 GOTO CANNOT_FIX
  70. GOTO RUN_CHECK
  71.  
  72. :NO_MEMORY
  73. ECHO                                    .
  74. ECHO OPTune needs either more RAM or more disk space available
  75. ECHO before it can operate on your system.
  76. GOTO BATCH_PAUSE
  77.  
  78. :FATAL_ERR
  79. ECHO                                    .
  80. ECHO OPTune encountered a fatal error.  You must manually use
  81. ECHO the Check-Disk command and/or the Verify/Fix-Disk command
  82. ECHO before OPTune will operate from the batch file.
  83. ECHO                                    .
  84. GOTO BATCH_PAUSE
  85.  
  86. :CHECK_DISK
  87. ECHO                                    .
  88. ECHO Press any key to run Check-Disk to fix errors on drive C.
  89. ECHO                                    .
  90. PAUSE
  91.  
  92. :RUN_CHECK
  93. ECHO                                    .
  94. \OPTUNE\OPTUNE C: /CF
  95. IF ERRORLEVEL 27 GOTO USER_ABORT
  96. IF ERRORLEVEL 1 GOTO CANNOT_FIX
  97. GOTO BATCH_PAUSE
  98.  
  99. :DISK_CACHE
  100. ECHO                                    .
  101. ECHO OPTune sensed a dangerous type of disk caching with which
  102. ECHO it cannot successfully operate.  Please turn disk caching
  103. ECHO off before running OPTune, or run OPTune before your disk
  104. ECHO caching is activated
  105. ECHO                                    .
  106. GOTO BATCH_PAUSE
  107.  
  108. :USER_ABORT
  109. ECHO                                    .
  110. ECHO The user pressed the ESC key to terminate early!
  111. GOTO BATCH_PAUSE
  112.  
  113. :CANNOT_FIX
  114. ECHO                                    .
  115. ECHO We could not completely fix the errors.  Please run OPTune
  116. ECHO again from the command line and identify and fix the
  117. ECHO problem.  Then, the next time you boot your computer it will
  118. ECHO be optimized.
  119.  
  120. :BATCH_PAUSE
  121. PAUSE
  122. :BATCH_END
  123.