home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 30 fixes_v
/
30-fixes_v.zip
/
p21sp.zip
/
OS2BOOT.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-06-07
|
15KB
|
505 lines
/* Create an OS/2 2.1 Boot Diskette & the Perfomance 2.1 Utility Diskette */
/* Copyright (c) 1992, 1993, 1994 CLEAR & SIMPLE, INC. */
ECHO OFF
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
'mode co80,27'
ver=sysos2ver()
if ver='2.11' then sp=1
else sp=0
objectName='O S 2 B O O T . C M D'
progid='OS2BOOT.CMD'
call source
call initVariables
call welcome
pos=SysCurPos(0,0)
'cls'
pos=SysCurPos(0,0)
say 'This program will create a bootable diskette for OS/2' ver
say;SAY GREEN;Say ' Label it "PERFORMANCE 2.1 OS/2 BOOT Diskette"';SAY BLUE;say
say 'It will also (optionally) create a second diskette containing several'
say 'utility functions that can only be run when you are booted from the'
say 'Boot Diskette.';say;SAY GREEN;SAY' Label it the "PERFORMANCE 2.1 UTILITY Diskette".';SAY BLUE;
say;say 'See the Software Chapter in the Performance 2.1 Book '
say 'for more information on the Utility disk. ';say
say 'You will need up to two (2) blank, formatted, High Density 3.5" diskettes.'
say '(one for the OS/2 Boot Diskette and one for the Utility Diskette.)'
say ' (or one 2.88MB diskette) '
say;say "To build a Boot Diskette you'll need the"
say 'OS/2 'ver' INSTALLATION diskette and OS/2 'ver' - Diskette 1'
if sp=1 then say 'or the OS/2 2.1 Service Pack Disk1 and Disk2';
SAY;SAY RED;say 'Do you have the necessary items and wish to continue? (Y/N) ';SAY BLUE
parse upper pull ans1 .
if ans1 \= 'Y' then do
say 'No diskettes will be created, per your request!'
say ' '; say 'Press Enter to End this Object'; pull
exit
end
else NOP
todrive = ' '
pctype = ' '
CALL getBOOT
say;say ' But first, I need some information from you!';say
do until todrive='A' | todrive='B'
say 'Please enter the diskette drive letter (e.g., "A" or "B") '
say 'where you want me to create the diskette(s).'
say red; say '(This must be a 3.5" disk drive.)';say blue
parse upper pull todrive
end
todrive = todrive||':'
do until fromdrive='A' | fromdrive='B'
say 'Please enter the diskette drive letter (e.g., "A" or "B") '
say 'where you will insert the OS/2 Install & Disk 1 diskettes.'
say '(This may be the same drive as above, and may be 5.25").'
parse upper pull fromdrive
end
fromdrive = fromdrive||':'
do until pctype = 1 | pctype = 2
say 'What type of machine do you have?'
say ' 1 = ISA (AT bus) or EISA bus'
say ' 2 = Microchannel (IBM PS/2 M55 or larger)'
say "You MUST enter either '1' or '2' "
pull pctype
end
say ' '
say ' Do you wish to build an OS/2 boot diskette? (Y/N)'
parse upper pull bdisk .
if bdisk \= 'Y' then do
say 'No OS/2 boot disk will be created, per your request!'
call doUtilDisk
pull
exit
end
t = 0
do while t = 0
say ' '
say 'I will need about 1.3 MB of temporary disk space to build a'
say 'boot diskette. Please enter the letter of the drive where you'
say 'want me to put the temporary files (e.g., "C", "D", etc.)'
say '(or just press Enter for the default of your current boot drive):'
parse upper pull tempdriv
if tempdriv = ' ' then do
tempdriv = Driveis
t = 1
end
else do
tempdriv = tempdriv||":"
map = SysDriveMap('C:', 'LOCAL')
parse value map with d.1 d.2 d.3 d.4 d.5 d.6 d.7 d.8 d.9
do d=1 to 9
if tempdriv = d.d then t = 1
end
end
end
say 'I am now ready to build an OS/2 boot diskette on' todrive
info = SysDriveInfo(tempdriv)
parse var info dr free total label
if free < 1300000 then do
freek = free/1024
freem = freek/1000
say 'You must have at least 1.3 MB on your ' tempdrive 'drive to run this utility.'
say 'You only have' freeM ' MB available. Please clear some disk space and try again.'
exit
end
say
'MD 'tempdriv'\cands >NUL'
b=0
do while b = 0
note.1 = 262
note.2 = 523
note.3 = 262
note.4 = 523
do i=1 to 4
call beep note.i,75
end
say red;SAY 'Please insert the OS/2 'ver' INSTALLATION DISKETTE in drive 'fromdrive;say blue
if sp=1 then say ' or the OS/2 2.1 Service Pack Disk1'
'PAUSE'
say
call SysFileTree fromdrive'\OS2LDR.', 'inst'
b=inst.0
end
say 'Copying files...'
"xCOPY" fromdrive"\OS2KRNL*. " tempdriv"\CANDS\OS2KRNL.* /t/h >NUL"
"xCOPY" fromdrive"\OS2LDR. " tempdriv"\CANDS\*.* /t/h >NUL"
"xCOPY" fromdrive"\SYSINSTX.COM " tempdriv"\CANDS\*.* >NUL"
"xCOPY" fromdrive"\OS2LDR.MSG "tempdriv"\CANDS\*.* /t/h >NUL"
say
b=0
do while b = 0
note.1 = 262
note.2 = 523
note.3 = 262
note.4 = 523
do i=1 to 4
call beep note.i,75
end
SAY 'Please insert the OS/2 'ver' DISKETTE 1 in drive 'fromdrive
if sp=1 then say ' or the OS/2 2.1 Service Pack Disk2'
else
'PAUSE'
say
call SysFileTree fromdrive'\HARDERR.EXE', 'inst'
b=inst.0
end
say 'Copying files...'
"COPY" fromdrive"\COUNTRY.SYS" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\PRINT0"pctype".SYS" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\SCREEN0"pctype".SYS" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\KBD0"pctype".SYS" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\CLOCK0"pctype".SYS" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\CMD.EXE" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\ANSICALL.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\B*.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\DOSCALL1.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\KBDCALLS.DLL" tempdriv"\CANDS\*.* >NUL "
say 'Still copying files...'
"COPY" fromdrive"\MOUCALLS.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\VIOCALLS.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\QUECALLS.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\SESMGR.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\OS2CHAR.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\NAMPIPES.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\MSG.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\NLS.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\NPXEMLTR.DLL" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\KEYBOARD.DCP" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\OS2DASD.DMD" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\IBMINT13.I13" tempdriv"\CANDS\*.* >NUL "
"COPY" fromdrive"\IBM"pctype"FLPY.ADD" tempdriv"\CANDS\*.* >NUL "
say
c=1
do while c \= 0
note.1 = 262
note.2 = 523
note.3 = 262
note.4 = 523
do i=1 to 4
call beep note.i,75
end
SAY 'Please insert a blank, formatted diskette for your'
SAY 'new boot diskette in drive ' todrive
say;say red; say 'This must be a formatted 3.5" HD diskette'
say 'DO NOT USE a DD (low density) Diskette that you formatted for 1.44MB!'
say blue
'PAUSE'
say
call SysFileTree todrive'\*.*', 'boot'
c=boot.0
if c\=0 then say 'Diskette is not completely blank, it may have hidden files'
end
say 'Loading System files...'
tempdriv"\CANDS\SYSINSTX "todrive
'ERASE 'tempdriv'\CANDS\sysinstx.com >NUL '
say 'Copying files to new boot diskette...'
"xCOPY "tempdriv"\CANDS\*.* "todrive"/t/h >NUL "
say 'Cleaning up temporary files... '
say 'the list of files vary by system type'
call elimdir tempdriv'\cands' Y
"COPY "Driveis"\OS2\HPFS.IFS "todrive" >NUL "
"COPY "Driveis"\OS2\OS2SCSI.DMD "todrive" >NUL "
if pctype = '2' then do
'copy 'driveis'\os2\abios.sys ' todrive '>NUL'
'copy 'driveis'\os2\*.bio ' todrive '>NUL'
end
say 'Making CONFIG.SYS for your new boot diskette...'
outfile = todrive"\CONFIG.SYS"
call lineout outfile, "REM This CONFIG.SYS created by Clear and Simple, Inc."
call lineout outfile, 'IFS=HPFS.IFS /CACHE:64'
call lineout outfile, 'BUFFERS=32'
call lineout outfile, 'IOPL=YES'
call lineout outfile, 'MEMMAN=NOSWAP'
call lineout outfile, 'PROTSHELL=CMD.EXE'
call lineout outfile, 'SET OS2_SHELL=CMD.EXE'
call lineout outfile, 'DISKCACHE=64,LW'
call lineout outfile, 'PROTECTONLY=YES'
call lineout outfile, 'LIBPATH=.;\;'
call lineout outfile, 'PAUSEONERROR=NO'
call lineout outfile, 'CODEPAGE=850'
call lineout outfile, 'DEVINFO=KBD,US,KEYBOARD.DCP'
call lineout outfile, 'DEVICE=\DOS.SYS'
call lineout outfile, 'SET PATH=.;\'
call lineout outfile, 'SET DPATH=\;'
call lineout outfile, 'SET KEYS=ON'
call lineout outfile, 'BASEDEV=IBM'pctype'FLPY.ADD'
if (pctype='1') then call lineout outfile, 'BASEDEV=IBM1S506.ADD'
call lineout outfile, 'BASEDEV=OS2SCSI.DMD'
call lineout outfile, 'BASEDEV=IBMINT13.I13'
call lineout outfile, 'BASEDEV=OS2DASD.DMD'
call lineout outfile
DROP outfile
say;say 'OS/2 2.1 Boot Diskette successfully created.'
say;say green; say 'When you use this diskette to boot, it is normal to get'
say ' an error message:'
say black;say ' SYS0318 - Message file OS001.MSG cannot be found';say green
say;say 'This should be followed by an [A:\] prompt - enter any commands there.';say blue;say
call doUtilDisk
call SysDropFuncs
say ' '
say 'Your new PERFORMANCE 2.1 Diskette(s) have been created.'
say ' - by -'
say 'CLEAR & SIMPLE, INC.'
SAY ' '
say ' '; say 'Press Enter to End this Object'
pull
exit
doUtilDisk:
say;say 'Do you want me to create a "Performance 2.1" Utility Diskette? (Y/N)'
parse upper pull chk1 .
if chk1 \= 'Y' then do
say ' '; say 'Are you sure? This is recommended!'
say ' '; say 'Last chance to make a Utility diskette? (Y/N)'; pull chk1
if chk1 \= 'Y' then do
say 'I will NOT create a Utility Diskette.'
say 'CLEAR & SIMPLE, INC.'
return
end
end
say ' '
c=1
do while c \= 0
note.1 = 262
note.2 = 523
note.3 = 262
note.4 = 523
do i=1 to 4
call beep note.i,75
end
SAY 'Please insert a second blank, formatted diskette which will'
SAY 'become the Utility Diskette in drive ' todrive
'PAUSE'
say ' '
call SysFileTree todrive'\*.*', 'chck'
if chck.0 \=0 then do; say 'diskette is not completely blank - it may have hidden files'
say 'We will assume there is enough room'
say '(ctrl-break) can stop the copies'
end
c=0
end
say red;say 'Copying CHKDSK.COM to the Utility Diskette...'
"COPY" Driveis"\OS2\CHKDSK.COM "todrive' >NUL '
"COPY" Driveis"\OS2\SYSTEM\OSO001.MSG "todrive' >NUL '
"COPY" Driveis"\OS2\DLL\UHPFS.DLL "todrive' >NUL '
say red;Say 'Copying PERFORMANCE 2.1 Utilities to the diskette...'
call SysFileTree 'os2boot.cmd', 'info', 'F'
parse upper var info.1 cdate ctime fsize attribs wherefile
parse var Wherefile Wdrive ':\' Wdir '\OS2BOOT.CMD'
wdrive=right(wdrive,1)
P2LOC=WDRIVE':\'WDIR
'COPY' P2LOC"\UTILp21\*.CMD" todrive' >NUL '
say green;Say 'Copying CONFIG.SYS to ORIGINAL.SYS on the Utility Diskette...'
"COPY" Driveis"\CONFIG.SYS "todrive"\ORIGINAL.SYS"' '
say;say 'Copying OS2.INI and OS2SYS.INI to the Utility Diskette...'
"xCOPY "driveis"\os2\os2*.ini "todrive"/t/h >NUL "
say blue;say;say ' '; say 'PERFORMANCE 2.1 Utility diskette Created!'
say; say 'Press Enter to End'
return
source:
parse upper source where
parse var where . . yes'\OS2BOOT.CMD'
rc=SysFileTree(yes'\MAP.CMD', stem, F)
if stem.0=0 then DO;
SAY 'This program has been modified to ONLY execute from the same'
say 'location where the entire Performance 2.1 PLUS product is installed.'
say 'We created this inconvience so that we could make it more '
say 'convienient to distribute this update over CompuServe.'
say;say 'Please copy this program 'progid 'to the correct drive'
say 'and directory where Performance 2.1 PLUS is installed, \PERF21 '
say '- so that it will properly execute.'
say; say 'If you do not have Performance 2.1 PLUS you may '
say 'purchase it from several stores that carry OS/2 Software. '
say 'You can also call Clear & Simple, Inc. at 203-658-1204, '
say 'or Fax (203) 651-0354, we accept VISA, MC or Discover credit cards.'
say;say 'The price of Performance 2.1 PLUS is only $39.95 '
say '- it includes a 100 page book dedicated to tuning your OS/2 system,'
say 'and 40 REXX utility programs that simplify the tuning process'
say 'and provide additional utility functions like backing-up your desktop'
say 'or making a single OS/2 Boot Diskette, etc.'
say;say 'Press enter to end.'
pull
exit
end
return
getBOOT:
bootdrive = Value('Path',,'OS2ENVIRONMENT')
parse upper var bootdrive bootdrive
Driveis = Substr(bootdrive,Pos('\OS2\SYSTEM',bootdrive)-2,2)
return
Welcome:
echo on
'prompt $p$E[0;'34';'47';'5';'5'm]'
echo off
'cls'
call SysCurState 'OFF'
call sysCurPos '4', '0'
msg.0 =12
msg.1 = blue
msg.2 = cr5 cr5' ┌────────────────────────────────┐'
msg.3 = cr5 cr5' │ │ '
msg.4 = cr5 cr5' │ P E R F O R M A N C E 2.1 │'
msg.5 = cr5 cr5' │ │ '
msg.6 = cr5 cr5' │ │'
msg.7 = cr5 cr5' │ │'
msg.8 = cr5 cr5' │ │'
msg.9 = cr5 cr5' │ │'
msg.10 = cr5 cr5' └────────────────────────────────┘'
msg.11 = hblue
msg.12 = cr5 ' Copyright (c) 1993 Clear & Simple, Inc. '
msg.13= ' Please Maximize SCREEN SIZE & Press Enter to Continue '
do i =1 to msg.0
say msg.i
end
call SysCurPos '19','0'
say red;
call sysCurPos '7', '22'
call syssay '────────────────────────────'
call sysCurPos '8', '21'
call syssay '─────────────────────────────'
say;
say red;
call sysCurPos '9', '21'
call syssay 'Go'
call sysCurPos '9', '23'
call syssay ' as fast as'
call sysCurPos '9', '35'
call syssay '32 bits'
call sysCurPos '11', '30'
call syssay ' will'
call sysCurPos '11', '35'
call syssay ' take'
say blue;
call sysCurPos '11', '41'
call syssay 'you!'
say hblack;
call sysCurPos '15', '0'
SAY' Please Maximize SCREEN SIZE & Press Enter to Continue...'
say red;
call sysCurPos '14', '26'
CALL SYSPAUSE ObjectName
call SysCurState 'ON'
'cls'
echo on
'prompt $p$E[0;'34';'47';'5';'5'm]'
echo off
'cls'
return
InitVariables:
CharSet:
/* Foreground colors, not highlighted*/
black ='
A'
red ='
A'
green ='
A'
yellow ='
A'
blue ='
A'
white ='
A'
/* Foreground colors, highlighted*/
hblack ='
A'
hred ='
A'
hgreen ='
A'
hyellow ='
A'
hblue ='
A'
hwhite ='
A'
blue_o_white = '
A'
white_o_blue ='
A'
white_o_red ='
A'
cursor_up ='A' /* Cursor up 1 line*/
cursor_up2 ='A' /* Cursor up 2 lines */
cursor_down ='B' /* Cursor down 1 line */
cursor_right ='C' /* Cursor right 1 space */
cr5 ='C' /* Cursor right 5 spaces */
normal ='A' /* Restore default attrib. and color */
reverse ='A' /* Reverse video */
highlight ='
A' /* Highlight */
invisible ='
A' /* Invisible */
return
SysPause:
parse arg prompt
if prompt='' then
prompt='Press Enter key when ready . . .'
call SysSay prompt
Pull .
say
return
SysSay:
parse arg string
call charout 'STDOUT', string
return