home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
MAKESP.ZIP
/
MAKESP.CMD
next >
Wrap
OS/2 REXX Batch file
|
1992-10-28
|
9KB
|
309 lines
/************************************************
* CSD disk copy command Written by D. Azzarito *
* *
* VERSION 1.12 - 10-28-92 *
* *
* This program will create the OS/2 2.0 CSD *
* diskettes from DSK images. It requires *
* LOADDSKF, VREXX, and the XR6055 images *
************************************************/
/********************
* Initialize VREXX *
********************/
call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
initcode = VInit()
if initcode = 'ERROR' then signal CLEANUP
signal on failure name CLEANUP
signal on halt name CLEANUP
signal on syntax name SYNTERR
/*******************************
* Set the disk counts (number *
* of disks for each size disk)*
*******************************/
DiskCount.3 = 14
DiskCount.5 = 16
/*********************
* check input parms *
*********************/
ARG DriveA DriveB
SELECT
WHEN DriveA = '5.25' THEN
DriveASize = '5'
WHEN DriveA = '3.5' THEN
DriveASize = '3'
OTHERWISE
DriveASize = 'BAD'
END
SELECT
WHEN DriveB = '5.25' THEN
DriveBSize = '5'
WHEN DriveB = '3.5' THEN
DriveBSize = '3'
OTHERWISE
DriveBSize = 'BAD'
END
/***********************************
* Pop up error if disk info is bad*
***********************************/
IF DriveASize = 'BAD' THEN DO
msg.0 = 6
msg.1 = 'Invalid drive types specified in parameters.'
msg.2 = ''
msg.3 = 'ex: If A: is a 5.25" drive, and B: is a 3.5" drive,'
msg.4 = ' the parameters to MAKCSD.CMD should be: 5.25 3.5'
msg.5 = ''
msg.6 = 'Correct the error and restart.'
call VDialogPos 50, 50
vrc = VMsgBox('PARAMETER ERROR', msg, 1)
CALL Vexit
EXIT -1
END
call VDialogPos 80, 80
/******************************
* MAIN LOOP: *
* We stay in this loop until *
* The user selects CANCEL *
******************************/
DO FOREVER
/*********************************
* Ask which drive we should use *
* for the disk creation *
*********************************/
List.0=2
List.1 = 'Full Set ('DiskCount.DriveAsize' 'DriveA' disks) on A: '
List.2 = 'Single disk ('DriveA' disk) on A:'
IF DriveBSize \= 'BAD' THEN DO
List.0=4
List.3 = 'Full Set ('DiskCount.DriveBsize' 'DriveB' disks) on B:'
List.4 = 'Single disk ('DriveB' disk) on B:'
END
vrc = VRadioBox('Select Service Pack to create', list, 3)
IF vrc \= 'OK' THEN
LEAVE
SingleDisk = 'NO'
SELECT
WHEN list.vstring = list.1 THEN DO
DriveCreate = 'A'
DriveSizeCreate = DriveASize
END
WHEN list.vstring = list.2 THEN DO
DriveCreate = 'A'
DriveSizeCreate = DriveASize
SingleDisk = 'YES'
END
WHEN list.vstring = list.3 THEN DO
DriveCreate = 'B'
DriveSizeCreate = DriveBSize
END
WHEN list.vstring = list.4 THEN DO
DriveCreate = 'B'
DriveSizeCreate = DriveBSize
SingleDisk = 'YES'
END
END
/********************************
* Process single disk requests *
********************************/
IF SingleDisk = 'YES' THEN DO
DO Temp = 1 TO DiskCount.DriveSizeCreate - 2
Single.Temp = Right(Temp,2,' ')' - Service Pack Disk 'Temp' of 'DiskCount.DriveSizeCreate - 2
END
DO Temp = DiskCount.DriveSizeCreate - 1 TO DiskCount.DriveSizeCreate
Single.Temp = Right(Temp,2,' ')' - Display Device Drivers Disk '||(-(DiskCount.DriveSizeCreate - Temp - 2))
END
Single.0 = DiskCount.DriveSizeCreate
vrc = VListBox('Select a Disk and Press OK', Single, 39, 8, 1)
SingleNum = LEFT(Single.vstring,2)
END
/************************************************************
* Check to see if the user wants the disks FORMATTED first *
************************************************************/
msg.0 = 2
msg.1 = 'Would you like the disks FORMATTED'
msg.2 = 'during the creation process?'
Format = VMsgBox('FORMAT OPTION', msg, 6)
/***************************
* MAIN DISK CREATION LOOP *
***************************/
IF SingleDisk = 'YES' THEN
LoopStart = SingleNum
ELSE
LoopStart = 1
DO CurrentDisk = LoopStart TO DiskCount.DriveSizeCreate
/**************************************
* Display message with disk label *
* Ask if user wants to make this one *
**************************************/
msg.0 = 7
msg.1 = 'Insert disk labelled:'
msg.2 = ''
msg.3 = ' IBM OS/2 version 2.0 Service Pack XR06055'
msg.4 = ' Diskette 'CurrentDisk' of 'DiskCount.DriveSizeCreate - 2
msg.5 = ''
msg.6 = ' in drive 'DriveCreate':'
msg.7 = 'Select OK to create, CANCEL to skip'
IF DiskCount.DriveSizeCreate - CurrentDisk < 2 THEN
msg.4 = ' Display Device Drivers Disk '||(-(DiskCount.DriveSizeCreate - CurrentDisk - 2))' of 2'
vrc = VMsgBox('Ready to create disk', msg, 3)
/**************************************
* User wants this image. Let's see *
* if the image file exists! *
**************************************/
IF vrc = 'OK' THEN DO
ImageFile = OVERLAY(CurrentDisk,'SPG'DriveSizeCreate'00.DSK',-(LENGTH(CurrentDisk)-7))
"@DIR " ImageFile" > NUL 2>&1"
/************************************
* TROUBLE! The image isn't here! *
************************************/
IF rc \= 0 THEN DO
msg.0 = 1
msg.1 = 'Image file ['ImageFile'] Not Found!'
call VMsgBox 'ERROR: File Not Found', msg, 1
END
/**********************************
* We have image, and are ready! *
**********************************/
ELSE DO
pos.left=0
pos.bottom=85
pos.right=55
pos.top=100
StatId=VOpenWindow('Service Pack diskette progress','WHITE',pos)
Call VSetFont StatId,'HELV',14
YPos = 500
IF Format = 'YES' THEN DO
/***********************************
* If they wanted FORMAT, we do it!*
***********************************/
Call VSay StatId,15,700,'Formatting Diskette in Drive 'DriveCreate':'
YPos = 300
'FORMAT 'DriveCreate': /ONCE /V:'CurrentDisk
END
/***********************************
* HERE'S WHERE THE IMAGE IS MADE *
***********************************/
Call VSay StatId,15,YPos,'Creating 'STRIP(msg.4)' in Drive 'DriveCreate':'
'LOADDSKF 'ImageFile' 'DriveCreate': /Y/Q'
Call VCloseWindow(StatId)
END /* END ELSE (image found) */
END /* END if vrc=OK (user wants this image) */
/***********************************
* User doesn't want this image. *
* Since VREXX can't ask Y/N/Quit, *
* we'll see if this is a SKIP, or *
* a request to ABORT. *
***********************************/
ELSE DO
msg.0 = 2
msg.1 = 'Select OK to skip to next disk,'
msg.2 = 'or CANCEL to abort operation'
vrc = VMsgBox('Diskette Abort Requested', msg, 3)
IF vrc = CANCEL THEN LEAVE
END
/***********************************
* If user only wanted one disk, *
* we can get out of town! *
***********************************/
IF SingleDisk = 'YES' Then
LEAVE
END /* END CurrentDisk loop */
/***********************************
* When we get here, the current *
* request is complete. *
***********************************/
msg.0 = 1
msg.1 = 'Service Pack Creation Complete!'
call VMsgBox 'Process Completed', msg, 1
END /* END Do Forever */
/************************
* Put up an "About Box *
* before we go *
************************/
msg.0 = 10
msg.1 = 'This program creates OS/2 SERVICE PACK diskettes from diskette'
msg.2 = 'images. This program is written entirely in the REXX language, using '
msg.3 = "Richard Lam's VREXX extensions. Anyone who wishes to create OS/2 "
msg.4 = '2.0 Service Pack diskettes is granted permission to use MAKESP.'
msg.5 = ''
msg.6 = 'For more information, contact:'
msg.7 = ' Doug Azzarito'
msg.8 = ' Compuserve: 72360,3555'
msg.9 = ' Internet: azzarito@cse.fau.edu'
msg.10 = ' Prodigy: HRTH52A'
vrc = VMsgBox('About the MAKESP Program', msg, 1)
/**************************************
* When we get here, the user said *
* he doesn't want to make any more *
* service packs. Clean up and EXIT! *
**************************************/
Call VExit
Exit 0
/* end of CMD file */
SYNTERR:
msg.0 = 1
msg.1 = 'Syntax Error!'
call VMsgBox 'REXX ERROR', msg, 1
CLEANUP:
call VExit
exit -1