(view source code of bootdriv.rex as plain text)
/* Check for boot drive *//* Techniques explained by Dick Goran in his January 1997 Rexx Column in *//* OS/2 Magazine, found at http://www.toward.com/cfsrexx/os2-mag/9701.htm *//* Display blank line */Say/* Check command line parameters (none required) */Parse Arg params
If params <> "" Then Call Syntax
/* What OS? */Parse Source os .
If os = "OS/2" Then Do
/* RLANUTIL.DLL, containg GetBootDrive, was added in Warp Connect */Call RxFuncAdd "GetBootDrive", "RLANUTIL", "GetBootDrive"
If RxFuncQuery( "GetBootDrive" ) = 0 then do
bootdrive = GetBootDrive()
EndElse Do
/* This should work in any pre Warp OS/2 version too */path = Value( "PATH", , "OS2ENVIRONMENT" )
Parse Upper Value path With ":\OS2\SYSTEM" -1 bootdrive +2
EndEndElse Do
/* Initialize RexxUtil library */If RxFuncAdd( "sysloadfuncs", "RexxUtil", "sysloadfuncs" ) = 0 Then Do
Call sysloadfuncs EndElse Do
Call Syntax "Error initializing RexxUtil"
Endbootdrive = SysBootDrive( )
EndSay "Boot drive = "||bootdrive
Exit 0
Syntax: Procedure
Parse Arg errmsg
If errmsg <> "" Then Say errmsg||"0D0A0D0A"X
Say "BootDriv.rex, Version 2.01 for OS/2 and Windows"
Say "Return drive letter from which computer was booted"
SaySay "Techniques for OS/2 explained by Dick Goran in his"
Say "January 1997 Rexx Column in OS/2 Magazine, found at"
Say "http://www.toward.com/cfsrexx/os2-mag/9701.htm"
SaySay "Usage: BOOTDRIV.REX"
SaySay "Written by Rob van der Woude"
Say "http://www.robvanderwoude.com"
Exit 1
Returnpage last modified: 2025-10-11; loaded in 0.0066 seconds