home *** CD-ROM | disk | FTP | other *** search
/ IBM CD Showcase / OS2_CD_ROM.iso / smce0001 / lotusss / makedsk.cmd < prev    next >
Encoding:
Text File  |  1994-05-06  |  2.6 KB  |  85 lines

  1. /*
  2.  * MAKEDSK.CMD
  3.  *
  4.  * Basic REXX exec to build a number of disks from disk images.
  5.  * The program calls LOADDSKF.EXE to do the actual load, and does some
  6.  * rudamentary error checking.
  7.  *
  8.  * Input on the command line determines the drive to build the disks on,
  9.  * the filenames of the files to feed to LOADDSKF, and the title of the disk
  10.  * to display to the user.  The number of disks is inferred from the number
  11.  * of parameters.  No error checking is done on the input.  Example input
  12.  * line follows.
  13.  *
  14.  *    MAKEDSK A: DISKIMG1.DSK /First disk/ DISKIMG2.DSK /Second disk/
  15.  *            -- ------------  ----------  ------------  ----------- 
  16.  *            |        |            |           |             |
  17.  *Output Drive+        |            |           |             |
  18.  *    First disk image +            |           |             |
  19.  *              Title of first disk +           |             |
  20.  *                            Second disk image +             |
  21.  *                                       Title of second disk +
  22.  *
  23.  * The title is delimited by forward slash characters (/).  These will not
  24.  * be displayed to the user.
  25.  * There is also a check for disk size.  In this release it is assumed to
  26.  * be 1.44 Mb.
  27.  */
  28.  
  29. Trace 'o'
  30. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  31. Call SysLoadFuncs
  32.  
  33. /* Parse the command line */
  34. Parse arg drive dskimg '/' title '/' remainder
  35.  
  36. size = 1457664
  37. nbr = 1
  38. CLS
  39. Do While dskimg \= ''
  40.   Say 'Put a blank diskette for disk' nbr || ', "' || title || '",'
  41.   Say 'into drive' drive || '.'
  42.   '@Pause'
  43.  
  44.   /* Make sure the disk is in the drive and that it is the right size */
  45.   dskinfo = SysDriveInfo(drive)
  46.   Parse Var dskinfo drv fre sze .
  47.   If drv = '' Then
  48.     Do
  49.       Say ''
  50.       Say 'ERROR: No diskette is present in drive' drive || '.'
  51.       Say ''
  52.       '@Pause'
  53.       Iterate
  54.     End
  55.   If sze \= size Then
  56.     Do
  57.       Say ''
  58.       Say 'ERROR: The diskette in drive' drive ' is not the correct density.'
  59.       Say '       Please replace with an appropriate diskette.'
  60.       '@Pause'      /* Added by Rune 6.5.94 */
  61.      Say ''
  62.       Iterate
  63.     End
  64.  
  65.   /* Store the disk image */
  66.   'LOADDSKF' dskimg drive
  67.   If rc \= 0 Then
  68.     Do
  69.       Say ''
  70.       Say 'ERROR:  Disk image did not load properly.  Diskette install terminating.'
  71.       '@Pause'  /* Added by Rune 6.5.94   */
  72.       Say ''
  73.       exit 1
  74.     End
  75.   Say ''
  76.  
  77.   /* Parse the next parameter */
  78.   Parse Var remainder dskimg '/' title '/' remainder
  79.   nbr = nbr + 1
  80.   CLS
  81. End /* Do While remainder \= '' */
  82.  
  83. Say 'All diskettes have been made.'
  84. '@Pause'
  85.