home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sysset12.zip
/
sysset.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
2000-06-02
|
2KB
|
84 lines
/**/
dll = 'SYSSET'
UnlockModule = 'syssetUnlockModule'
class.0 = 1
class.1 = 'WPSysset'
/**/
call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
call SysLoadFuncs
if RxFuncQuery('UnlockModule') = 0 then
call RxFuncDrop 'UnlockModule'
call RxFuncAdd 'UnlockModule', dll, UnlockModule
dll = dll'.DLL'
arg opt
select
when opt = 'I' then do
call SysFileTree dll, 'stem', 'O'
if stem.0 = 0 then
say 'Unable to locate' dll
else do
do i = 1 to class.0
call register class.i
end
call createobj
end
end
when opt = 'U' then do
call deleteobj
do i = 1 to class.0
call deregister class.i
end
call charout , 'Unlocking' dll': '
rc = UnlockModule(dll)
if rc = 0 | rc = 296 then
say 'Success'
else
say 'Failure'
end
otherwise
parse upper source . . me
me = filespec('N', me)
say
say 'Usage:' left(me, lastpos('.', me) - 1) '<option>'
say
say 'Option is: I - Install'
say ' U - Uninstall'
end
call RxFuncDrop 'UnlockModule'
return
register:
parse arg newclass
call charout , 'Registering class' newclass': '
if SysRegisterObjectClass(newclass, stem.1) \= 0 then
say 'Success'
else
say 'Failure'
return
deregister:
parse arg newclass
call charout , 'Deregistering class' newclass': '
if SysDeregisterObjectClass(newclass) \= 0 then
say 'Success'
else
say 'Failure'
return
createobj:
call charout , 'Creating Sysset object: '
if SysCreateObject('WPSysset', 'Sysset', '<WP_NOWHERE>',,
'OBJECTID=<SYSSET>') \= 0 then
say 'Success'
else
say 'Failure'
return
deleteobj:
call charout , 'Deleting Sysset object: '
if SysDestroyObject('<SYSSET>') \= 0 then
say 'Success'
else
say 'Failure'
return