home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / msdos / programm / 8584 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  5.8 KB

  1. Path: sparky!uunet!uunet.ca!geac!r-node!bville!greg.vigneault
  2. From: greg.vigneault@bville.gts.org (Greg Vigneault) 
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: VOLUME LABEL'S
  5. Message-ID: <1271.549.uupcb@bville.gts.org>
  6. Date: 17 Aug 92 11:25:00 GMT
  7. Distribution: world
  8. Organization: Baudeville BBS - Toronto, Canada 416-283-0114/6059* *v32bis/HST
  9. Reply-To: greg.vigneault@bville.gts.org (Greg Vigneault) 
  10. Lines: 100
  11.  
  12.  In message<hvisage.713546489@rkw-risc>
  13.  Per: Volume label's
  14.  hvisage@rkw-risc.cs.up.ac.za (Hendrik Visage) wrote...
  15.  
  16. HV> I need to change, create and delete volume labels in
  17.   > TP6.0, TC++ or TASM. under MS-DOS 5.00. If possible please
  18.   > send EMail.
  19.  
  20.  This TP Unit reads/writes disk volume labels & serial numbers...
  21. (*-------------------------------------------------------------------*)
  22. UNIT Volume;    { Version 0.3ap, for Turbo Pascal 4, 5.x, and 6 }
  23. INTERFACE       { Tested under MS-DOS version 3.3 and 4.01 }
  24. TYPE VolLabel = String[11]; { volume lable is 11 characters maximum }
  25. FUNCTION GetLabel( Drive :CHAR ) :VolLabel;
  26.     { Returns 11-char volume label, or nul string if none.
  27.       Drive is 'A'..'Z', or '.' for current volume }
  28. FUNCTION SetLabel( Drive :CHAR; VolStr :VolLabel ) :BYTE;
  29.     { sets volume label (pads to 11-chars if needed), returning a
  30.       BYTE result code (0..6) ...
  31.       0 = okay
  32.       1 = IF NOT Drive IN ['.', 'A'..'Z']  | 4 = label creation error
  33.       2 = label read error                 | 5 = label deletion error
  34.       3 = VolStr error (eg. too long)      | 6 = label renaming error }
  35. FUNCTION GetVolume :CHAR;
  36.     { returns current logged-in volume, letter 'A'..'Z' }
  37. FUNCTION SetVolume( Drive :CHAR ) :BYTE;
  38.     { logs into the root of volume 'A'..'Z'
  39.       returns BYTE of 0 if okay, else returns MS-DOS error code}
  40. FUNCTION GetSerial( Drive :CHAR ) :LONGINT; { ** MS-DOS 4.0 & above }
  41. FUNCTION SetSerial( Drive :CHAR; SerialNum :LONGINT ) :WORD;
  42.     { returns WORD of 0 if okay, else error number (DOS 4 & above) }
  43. FUNCTION VolSerHexStr( SerialNum :LONGINT ) :String;   { String[9] }
  44.     { converts binary SerialNum to hex string in form of '0000-0000' }
  45. IMPLEMENTATION
  46. USES Dos;           { updates TP's DosError global }
  47. {$L VOLUME03.OBJ}   { implemented in Assembly (FAR calls) }
  48. FUNCTION GetLabel( Drive :CHAR ) :VolLabel;                 EXTERNAL;
  49. FUNCTION SetLabel( Drive :CHAR; VolStr :VolLabel ) :BYTE;   EXTERNAL;
  50. FUNCTION GetSerial( Drive :CHAR ) :LONGINT;                 EXTERNAL;
  51. FUNCTION SetSerial( Drive :CHAR; SerialNum :LONGINT ) :WORD;EXTERNAL;
  52. FUNCTION GetVolume :CHAR;                                   EXTERNAL;
  53. FUNCTION SetVolume( Drive :CHAR ) :BYTE;                    EXTERNAL;
  54. FUNCTION GetVolVer:WORD; {util ver,AH=major,AL=minor}       EXTERNAL;
  55. FUNCTION VolSerHexStr( SerialNum : LONGINT ) :String;       EXTERNAL;
  56. END. { Unit Volume. Copyright 1991, 1992 Gregory S. Vigneault }
  57. (*------------------------------------------------------EnHex-A1.3p--*)
  58.  To obtain VOLUME03.OBJ from this message, follow these 4 steps ...
  59.  1) put the next 34 encoded lines into a text file named VOLUME03.HEX
  60.  
  61. :1E0000001A08564F4C554D4530332E4F424A00B60300009818EC8E1A8FB00400000C30
  62. :1E001E00801C006060E70D9B3A6DCAC098E122C894265C2C31000080009120548210BB
  63. :1E003C0018F284489110980E00004351408000FD420200A247C08093A0182D00808053
  64. :1E005A00C8932945A448792205403C4800D8946460E509139C529014C132858A942BEB
  65. :1E00780014111C2942854910214598AC8A8AB3EAD5ACE62826984A056992204C280258
  66. :1E00960048D0D52C5A1562C9166552A549113E71A9CEB592F38ED8AE73EB165144F15F
  67. :1E00B4000B22021445058806AA49000114AB2C62E781113247D8141931808EA21C09D5
  68. :1E00D200A1282EB24071C6B60F893C50ECA20CF2226C3380CD90B6EE9D64CA96316B4B
  69. :1E00F00056D019809C0A8BAC1848441A407004C429F6962320F68751AB95190070DBB6
  70. :1E010E0043313F0A8C1518BBC80882DEDA5B1CE9CE99E207D6885D8406B02C3674001D
  71. :1E012C00B432340B4120880C72CBAAE7CEBC5914455D14D1B2C37CCC39F71E6B90E960
  72. :1E014A0077197FE5F9F6416F7568E00B45C4F881402E339980480347F0330F290646C7
  73. :1E01680007598508C8008C8605F803CC3AEC28A89B11BC7986426F7430D01B2C00D449
  74. :1E018600C1416FEB5C4063013C3600207C17CCA700307408008B01F73D17DD74280C5F
  75. :1E01A40091420C39E420030847C851C61956A471861B658451071B740C00C00F3A7076
  76. :1E01C2000100240780C0492E0010329100022012003111004067117756A0A70047DC04
  77. :1E01E000C98101271162C39F7612F3C39F7C1263C49F811292C49F9DDC1905A10110B8
  78. :1E01FE0062C69F580840081C9C0A404C1E7FF670E71F981263C99F3FDC9909AB779633
  79. :1E021C00822921B7FCA91821BCFC09CC9DC1FC49C69DD4CC2A8FAD99DEA36BA6FCFCA7
  80. :1E023A00198300859849E7638520A02CB30DFC298200C548F0271701142302A61B88C4
  81. :1E025800229000490430530000A04B5100205823AE9E5404202DBAEAA60B8233A01480
  82. :1E027600A027B7FFF4F3AE005D04A02FBD6AA18B0E28D3092086BC01B0F3EFAFE7A692
  83. :1E0294005BF00F9CFCFB86C012D78BAEBBE3D2616EC60583B0CABF7F049000C8EB0269
  84. :1E02B200200C28F6E869E7720F40719F22991133242D69CC87C53050D012C03AEEF0D0
  85. :1E02D000E0021D0E90F00D0F41C801010F5ADCC1000B40AC238089FE0170E430B004FC
  86. :1E02EE0090CF301302802100B0FC709811E2EC7373044602038B00759840CB0BF30D37
  87. :1E030C00320C028BECF375D73783609A098A0480080087C8830808810F218E3C267215
  88. :1E032A004DD12F147D6D1A61761A9ECFCD16A45D4700581330CCCD13588E392C050C24
  89. :1E03480053A1017C37A04032746000483E0BDC31C1115D3FFE0EDF7E0360383E89C36F
  90. :1E03660032C0D58B40A30831BDF51E0B015048834E6F5890F0000F0A3047C00104C06A
  91. :1E038400804801E309330C059C8C1127BA742A464CB5740E71E70B7F8E71670EBEDEEF
  92. :1E03A200F9289DDC12F345FAC488F1A7C7C4E831FF9D7DC0CFC8B6776EC2BFCDF72364
  93. :1503C0004435FE14064F7DE34F6A10400214011900D0011A00C4
  94. :00000001FF
  95.  
  96.  2) put the following 7 lines into a text file named VOLUME03.DO
  97.         Nvolume03.HEX
  98.         Lcs:100
  99.         Rcx
  100.         03D5
  101.         Nvolume03.ARC
  102.         Wcs:100
  103.         Q
  104.  3) type "DEBUG < VOLUME03.DO" to create VOLUME03.ARC from VOLUME03.HEX
  105.  4) extract VOLUME03.OBJ from VOLUME03.ARC using PAK or PKUNPAK
  106. (*-------------------------------------------------------------------*)
  107.  
  108.  Greg_
  109.  greg.vigneault@bville.gts.org
  110.  Aug.17.1992.Toronto.Canada
  111.               
  112.