home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR21 / LANLOG11.ZIP / COLLEG01.BAT next >
DOS Batch File  |  1993-08-01  |  4KB  |  112 lines

  1. ECHO OFF
  2. CLS
  3. rem     This BAT file provides an example collection facility for meter
  4. rem     files held at stand alone PCs.
  5. rem
  6. rem           Title: Meter and Log file Collection utility
  7. rem     Description: This BATCH file requires a string with which to
  8. rem                  name the files it copies. This utility presumes
  9. rem                  installation took place using the default settings
  10. rem                  therefore data will be written to C:\LANLOG.DAT in
  11. rem                  data files LLOGDAT.MET and/or LLOGDAT.LOG
  12. rem
  13. rem    Improvements: It is relatively easy to collect data files in a
  14. rem                  compressed form by modifying this batch file and
  15. rem                  including a copy of PKZip or LHARC on the diskette.
  16.  
  17. rem     check to see user has provided a data file name
  18.  
  19. if "%1"=="" goto error1
  20.  
  21. rem     check to see if files already exist on A: drive
  22.  
  23. if exist A:\%1.LOG goto error2
  24.  
  25. if exist A:\%1.MET goto error2
  26.  
  27. rem     user has provided a file name that isn't a duplicate
  28.  
  29. :COLL
  30.  
  31. ECHO    ╔══════════════════════════════════════════════════════╗
  32. ECHO    ║     Collection of Meter and/or Log files from PCs    ║
  33. ECHO    ╠══════════════════════════════════════════════════════╣
  34. ECHO    ║                                                      ║
  35. ECHO    ║        Collection will take only a few moments.      ║
  36. ECHO    ║                                                      ║
  37. ECHO    ║ NOTE: Please ensure you have enough disk space on    ║
  38. ECHO    ║       the floppy disk for the meter and/or log       ║
  39. ECHO    ║       files.                                         ║
  40. ECHO    ║                                                      ║
  41. ECHO    ║   {Cntrl-C} = terminate, any other key = continue    ║
  42. ECHO    ║                                                      ║
  43. ECHO    ╚══════════════════════════════════════════════════════╝
  44.  
  45. rem     get user response
  46.  
  47. PAUSE
  48.  
  49. if not exist C:\LANLOG.DAT\LLOGDAT.LOG goto GETMET
  50.  
  51. COPY C:\LANLOG.DAT\LLOGDAT.LOG A:\%1.LOG > nul
  52.  
  53. :GETMET
  54.  
  55. if not exist C:\LANLOG.DAT\LLOGDAT.MET goto QUIT
  56.  
  57. COPY C:\LANLOG.DAT\LLOGDAT.MET A:\%1.MET > nul
  58.  
  59. goto QUIT
  60.  
  61. :ERROR1
  62.  
  63. rem     user didn't provide a command line parameter for created data
  64. rem     file name.
  65.  
  66. CLS
  67.  
  68. ECHO    ╔══════════════════════════════════════════════════════╗
  69. ECHO    ║                     SYNTAX ERROR                     ║
  70. ECHO    ╠══════════════════════════════════════════════════════╣
  71. ECHO    ║                                                      ║
  72. ECHO    ║ This BATCH file requires a name with which to create ║
  73. ECHO    ║ unique data files on the floppy disk.                ║
  74. ECHO    ║                                                      ║
  75. ECHO    ║ The correct syntax:                                  ║
  76. ECHO    ║                                                      ║
  77. ECHO    ║               COLLEG01 {name}                        ║
  78. ECHO    ║                                                      ║
  79. ECHO    ║ where {name} is any DOS valid 8 character string.    ║
  80. ECHO    ║                                                      ║
  81. ECHO    ║ Example:                                             ║
  82. ECHO    ║                                                      ║
  83. ECHO    ║               COLLEG01 GEORGE                        ║
  84. ECHO    ║                                                      ║
  85. ECHO    ║                                                      ║
  86. ECHO    ╚══════════════════════════════════════════════════════╝
  87.  
  88. goto QUIT
  89.  
  90. :ERROR2
  91.  
  92. rem     user provided a command line parameter but a duplicat file name
  93. rem     exists.
  94.  
  95. CLS
  96.  
  97. ECHO    ╔══════════════════════════════════════════════════════╗
  98. ECHO    ║                 NAME ALREADY EXISTS!                 ║
  99. ECHO    ╠══════════════════════════════════════════════════════╣
  100. ECHO    ║                                                      ║
  101. ECHO    ║ The name you provided for the collected data file    ║
  102. ECHO    ║ already exists, please think of another file name    ║
  103. ECHO    ║ and try again.                                       ║
  104. ECHO    ║                                                      ║
  105. ECHO    ╚══════════════════════════════════════════════════════╝
  106.  
  107. rem     The End
  108.  
  109. :QUIT
  110.  
  111. ECHO ON
  112.