home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rxhll.zip
/
SYSTEM.REX
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-01-21
|
1KB
|
59 lines
/* #include <system.rex> */
/**
*** ┌───────────────────────────────────────────────────────────────────────┐
*** │ Misc system functions │
*** └───────────────────────────────────────────────────────────────────────┘
**/
ThisDirectory: procedure
/**
*** This will return the directory from which this exec was run
**/
parse source . . ThisFile
LastSlash = lastpos('\', ThisFile)
ThisDir = left(ThisFile, (LastSlash-1))
return ThisDir
SystemDirectory: procedure
/**
*** This will try to determine where the OS/2 system is located by
*** looking for a key DLL
**/
dir = "C:\OS2"
code = RxQueue('Create','SysDir')
que = RxQueue('Set' ,'SysDir')
'@pstat /L | rxqueue SysDir'
do while queued() > 0
pull line
if pos('DOSCALL1.DLL', line) > 0 then
do
line = word(line, words(line))
parse var line dir '\DLL\DOSCALL1.DLL'
do queued();pull .;end
end
end
code = RxQueue('Delete','SysDir')
que = RxQueue('Set' ,que)
return strip(dir)
SystemDrive: procedure
/**
*** This will return the single drive letter for the system
**/
path = translate(value("PATH",,"OS2ENVIRONMENT"))
psn = pos(":\OS2",path)
if psn < 1 then
BootDrive = 'C'
else
BootDrive = substr(path,(psn-1),1)
return BootDrive