home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / pbcal112.zip / OPTIMIZE.BAT < prev    next >
DOS Batch File  |  1996-06-17  |  2KB  |  65 lines

  1. @echo off
  2.  
  3. echo ┌──────────────────────────────────────────────────────────┐
  4. echo │ This batch file optimizes your calendarfile by exporting │
  5. echo │ everything from the file and then importing it again.    │
  6. echo └──────────────────────────────────────────────────────────┘
  7. echo.
  8. set calfilename=%1
  9. if not "%1"=="" goto continue
  10. set calfilename=default.cal
  11.  
  12. echo ┌──────────────────────────────────────────────────────────┐
  13. echo │No option is specified!                                   │
  14. echo │default.cal is assumed.                                   │
  15. echo │                                                          │
  16. echo │To select another file use:                               │
  17. echo │optimize [filename]                                       │
  18. echo └──────────────────────────────────────────────────────────┘
  19. echo.
  20.  
  21. :continue
  22. echo.┌──────────────────────────────────────────────────────────┐
  23. echo │Press any key to continue or                              │
  24. echo │press ctrl-c to stop now!                                 │
  25. echo └──────────────────────────────────────────────────────────┘
  26. echo.
  27. pause > nul
  28.  
  29. if not exist %calfilename% goto nofile
  30.  
  31. if exist *.dac goto dacs_found
  32.  
  33. calport -f %calfilename% -e *
  34. if not exist *.dac goto export_error
  35. del %calfilename%
  36.  
  37. calport -f %calfilename% -i week*.dac
  38. del week*.dac
  39. calport -f %calfilename% -i month*.dac
  40. del month*.dac
  41. calport -f %calfilename% -i year*.dac
  42. del year*.dac
  43. calport -f %calfilename% -i t*.dac
  44. del t*.dac
  45.  
  46. rem This is for support for future version of cal
  47. calport -f %calfilename% -i *.dac
  48. del *.dac
  49.  
  50. goto end
  51.  
  52. :nofile
  53. echo Can't find %calfilename%
  54. goto end
  55.  
  56. :dacs_found
  57. echo There are .dac files in the directory already
  58. goto end
  59.  
  60. :export_error
  61. echo Error exporting .dac files
  62. goto end
  63. :end
  64. set calfilename=
  65.