home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
ice2chat.zip
/
ICE2Chat.cmd
next >
Wrap
OS/2 REXX Batch file
|
1997-05-07
|
4KB
|
141 lines
/* MR/2 ICE filter append for NetChat/2 */
Main:
signal on halt
call rxfuncadd 'sysloadfuncs','rexxutil','sysloadfuncs'
call sysloadfuncs
call SysCls
say 'MR/2 ICE filter append for NetChat/2'
say 'Written by: Lawrence Lucier (lucier@bossie.cow-net.com)'
say ' Barry Adams (barry@inorbit.com) April 30th 1997'
say
say
say 'These available drive designations where found:'
say SysDriveMap('C:', 'USED')
say
say 'Which drive is MR/2 ICE installed on? (Type letter only)'
pull Mr2IceDrive
call SysCls
say
say 'Scanning '||Mr2IceDrive||': for copies of MR/2 ICE filter files.....please wait!'
say
say
rc = CALL SysFileTree(Mr2IceDrive||':\mr2i.flt', 'file', 'SO')
say file.0
if file.0 > 0 then
do
call SysSleep 3
do i=1 to file.0
CALL SysCls
CALL FileSpecs
say
say
say "Found "||ProgramFile||' in '||HardDrive||FilePath
say 'Do you wish to update this copy of mr2i.flt?(y/n)'
parse pull answer
if answer = 'n'
then
iterate i;
else
CALL ChangeToNewDirectory
CALL MakeOpenNCcommandFile
CALL FileSpecs
CALL AppendFilterLine
end
exit
end
else
/* Branching code for when no MR2I.FLT files exist................BEGINS */
say file.0
say 'Scanning '||Mr2IceDrive||': for MR/2ICE directory.....please wait!'
say
say
pc = CALL SysFileTree(Mr2IceDrive||':\mr2i.exe', 'file', 'SO')
call SysSleep 3
do i=1 to file.0
CALL SysCls
CALL FileSpecs
say
say
say "Found "||ProgramFile||' in '||HardDrive||FilePath
say 'Do you wish to update this MR2ICE directory?(y/n)'
parse pull answer
if answer = 'n'
then
iterate i;
else
CALL ChangeToNewDirectory
CALL MakeOpenNCcommandFile
CALL FileSpecs
CALL WriteNewFilterFile
end
exit
/* Branching code for when no MR2I.FLT files exist................ENDS */
WriteNewFilterFile:
Change_Slash = translate(FilePath, '/', '\')||'opennc.cmd'
ChangeSlashes = translate(Change_Slash)
rc = LINEOUT(mr2i.flt,'+NetChat\nchat\8\NETCHATMSG\\\Default Reply Template\\nchat\'||HardDrive||ChangeSlashes||'\0\0\FSMYNNNNNNNYAM')
rc = LINEOUT(mr2i.flt)
return
FileSpecs:
FoundFile = file.i
FilePath = filespec("PATH",FoundFile)
HardDrive = filespec("DRIVE",FoundFile)
ProgramFile=filespec("NAME",FoundFile)
return
ChangeToNewDirectory:
NewDirString = strip(FilePath,t,'\')
NewDirectory = HardDrive||NewDirString
say
say
call directory(NewDirectory)
say 'Changed over to: '||NewDirectory
say
return
AppendFilterLine:
say 'Making backup copy of original MR2I.FLT file.....renamed to MR2I_FLT.ORG'
'@copy mr2i.flt /A mr2i_flt.org'
say
say
myfile=ProgramFile
Change_Slash = translate(FilePath, '/', '\')||'opennc.cmd'
ChangeSlashes = translate(Change_Slash)
ReplacementString = '+NetChat\nchat\8\NETCHATMSG\\\Default Reply Template\\nchat\'||HardDrive||ChangeSlashes||'\0\0\FSMYNNNNNNNYAM'
say
say
rc = LINEOUT(myfile,ReplacementString)
rc = LINEOUT(myfile)
say ProgramFile||' in '||HardDrive||FilePath||' successfully updated!'
call SysSleep 5
return
MakeOpenNCcommandFile: /* writes opennc.cmd to disk */
say 'Checking for existing copy of OPENNC.CMD.'
DoesCmdFileExist =stream('OPENNC.CMD','c','query exists')
if DoesCmdFileExist <> ' ' then do
say 'OPENNC.CMD already present in directory........renaming it to OPEN_CMD.ORG!'
'@copy opennc.cmd /A open_cmd.org'
end
say 'Writing OPENNC.CMD to disk.'
rc = LINEOUT(opennc.cmd,'/*opennc*/')
rc = LINEOUT(opennc.cmd,"mydirectory="||"'"||NewDirectory||"'")
rc = LINEOUT(opennc.cmd,'call directory (mydirectory)')
rc = LINEOUT(opennc.cmd,"'@pstat /c | find "NETCHAT.EXE" >nul'")
rc = LINEOUT(opennc.cmd,'if rc \= 0 then')
rc = LINEOUT(opennc.cmd,"/*it's not running therefore start it*/")
rc = LINEOUT(opennc.cmd,"start 'netchat.exe -m'")
rc = LINEOUT(opennc.cmd)
return