home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / UTILITY / CHKDISK.ZIP / CHKDISK.MOD
Text File  |  1993-05-17  |  3KB  |  82 lines

  1. Diamond #1 @3956 7[1System Operator7]0
  2. Sunday, May 16, 1993 at Ten in the morning
  3. 0R: net33: @2050 (via @1040) [14:28 05/16/93]
  4. 0R: net33: @1021 (via @3950) [10:14 05/16/93]
  5. Here's a small (51 bytes) utility I've written that checks the disk in the A: 
  6. drive and returns an errorlevel of 1 if a disk is found with the volume label 
  7. "!BACKUP!" 
  8.  
  9. I wrote this so my daily maintenance batch file can detect whether it's okay 
  10. to update a set of backup files on a floppy that's in my drive most of the 
  11. time.  The drive letter and volume name can be hex edited to whatever you 
  12. please; however changing the length of that string requires the source code, 
  13. which follows the UUE.
  14.  
  15.  
  16. (world's smallest UUE)
  17.  
  18. section 1 of uuencode 5.15 of file chekdisk.com    by R.E.M.
  19.  
  20. begin 644 chekdisk.com
  21. M#A\.![0EL"2Z)0'-(;HH`;D(`+1.S2%R!K1,L`'-(;1,L`#-(;`"ST$Z(4)!
  22. &0TM54"$`
  23. `
  24. end
  25. sum -r/size 11071/101 section (from "begin" to "end")
  26. sum -r/size 8542/51 entire input file
  27.  
  28.  
  29. Source code to chekdisk.com:
  30.  
  31. ;Chekdisk by Diamond:
  32. ;Check a: drive for a certain volume label, and return errorlevel 1 if found, 
  33. ;0 if not found or no disk in drive.  Traps critical error handler
  34. ;This code written for TASM 1.0
  35. ;
  36. ;by Diamond, WWIVnet IceNET WWIVlink #1 @3956  FILEnet #1 @710  StarNet #1 @10 
  37. ;If you use this code, or modify & redistribute it, please give credit where
  38. ;credit is due. 
  39.  
  40. title   chekdisk
  41.  
  42. code    segment
  43.         assume cs:code, ds:nothing, es:nothing
  44.         org 100h
  45.  
  46. start   proc
  47.  
  48.         push cs                 ;make local data addressable
  49.         pop ds
  50.         push cs
  51.         pop es
  52.  
  53.         mov ah,37               ;grab critical error handler in case there
  54.         mov al,36               ;is no disk in the drive.
  55.         mov dx,offset handler   ;offset of our handler
  56.         int 21h
  57.  
  58.         mov dx,offset asciiz    ;look for the volume label
  59.         mov cx,8                ;volume label (attribute to look for)
  60.         mov ah,78               ;find first function
  61.         int 21h
  62.         jc error
  63.  
  64.         mov ah,76               ;return errorlevel 1
  65.         mov al,1
  66.         int 21h
  67.  
  68. error:  mov ah,76               ;return errorlevel 0
  69.         mov al,0
  70.         int 21h
  71.  
  72. handler: mov al,2               ;critical errors go here.
  73.         iret                    ;return "abort" response
  74.  
  75. start   endp
  76.  
  77. asciiz  db 'A:!BACKUP!',0       ;Drive letter + Volume label + zero byte
  78.  
  79. code    ends
  80.  
  81. end     start
  82.