home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / utility / diffx.zip / DIFF.ZIP / SCANNER.BAT < prev   
DOS Batch File  |  1990-07-03  |  3KB  |  86 lines

  1. @echo off
  2. goto start
  3. rem ** This is a batch file to automate the Crude Security System described in
  4. rem ** the DIFF documentation.
  5. rem **
  6. rem ** The batch file will take either 1 or no parameters.
  7. rem ** If you type 'SCANNER M', it will make a Benchmark file for you.
  8. rem ** If you don't type any parameters, it will check and report differences.
  9. rem ** As long as the batch file is found in your DOS path, you can run it
  10. rem **   from anywhere with the same results.
  11. rem **
  12. rem ** If there are 0-1 differences, it simply displays them, and quits.  You
  13. rem **    may want to change the 2 for Yellow-Alert to a 0 so it will pause
  14. rem **    even if there is only 1 difference.  I usually have 1 difference,
  15. rem **    so I don't make it pause.
  16. rem ** If there are 2-10 differences, it displays them, pauses, and then quits.
  17. rem ** If there are 11-20 differences, it displays them, displays a message,
  18. rem **    pauses, then enters a lister to allow you to browse through the list.
  19. rem ** If there are 20-250 differences, it displays them, displays a message,
  20. rem **    pauses, then enters a lister to allow you to browse through the list.
  21. rem ** If there are more than 250 differences, if displays them, displays a
  22. rem **    message, pauses, then enters a lister to allow you to browse through
  23. rem **    the list.
  24. rem **
  25. rem **
  26. rem ** Initially, the batch file specifies several things that you may need
  27. rem **    to change. 
  28. rem ** You may need to change ANYTHING that is in UPPERCASE characters.
  29. rem ** You may also want to delete these comment lines from this batch file
  30. rem **    so that it will execute faster.  Users with a disk caching utility
  31. rem **    will probably not notice much difference with or without them.
  32.  
  33. :start
  34. if %1' == m' goto make
  35. if %1' == M' goto make
  36. goto check
  37.  
  38. :make
  39. diff /m-C:\DIFF.LOG /o /r C:\
  40. if errorlevel 251 goto error
  41. goto end
  42.  
  43.  
  44. :check
  45. diff /c-C:\DIFF.LOG /d-C:\DIFF.DIF /s /r C:\
  46. if errorlevel 255 goto lots
  47. if errorlevel 251 goto error
  48. if errorlevel 21 goto red
  49. if errorlevel 11 goto orange
  50. if errorlevel 2 goto yellow
  51. goto end
  52.  
  53.  
  54. :lots
  55. cls
  56. echo More than 250 differences found.
  57.  
  58.  
  59. :red
  60. cls
  61. echo Between 20 and 250 differences found.
  62. goto list
  63.  
  64.  
  65. :orange
  66. cls
  67. echo Between 10 and 20 differences found.
  68.  
  69.  
  70. :list
  71. pause
  72. rem Display the difference file using LIST - Vern Buerg's file display utility
  73. rem Almost any browsing utility or text editor should work just fine in place
  74. rem of LIST.
  75. LIST C:\DIFF.DIF
  76. goto end
  77.  
  78. :yellow
  79. echo Between 2 and 10 differences were found
  80.  
  81. :error
  82. pause
  83.  
  84. :end
  85. cls
  86.