home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: WPS_PM
/
WPS_PM.zip
/
of_98212.zip
/
OF.CMD
next >
Wrap
OS/2 REXX Batch file
|
1998-07-31
|
2KB
|
75 lines
/*
* Pgm Name : E:\DB\BATCH\CMD\PPWIZARD.CMD
* Pgm Version : 98.212
* Time : Friday, 31 Jul 1998 8:45:39pm
* Input File : E:\DB\PROJECTS\OS2\of\OF.x
* Output File : .\OUT\OF.CMD
*/
PgmVersion= "98.212"
Escape=d2c(27)
Red=Escape|| '[0;1;31m'
Reset=Escape|| '[0m'
call RxFuncAdd 'SysSetObjectData', 'RexxUtil', 'SysSetObjectData'
say "[]--------------------------------------------------------[]"
say "| OF.CMD, Version " || PgmVersion || " (C)opyright Dennis Bareis 1998 |"
say '| http://www.ozemail.com.au/~dbareis (db0@anz.com) |'
say "[]--------------------------------------------------------[]"
say ""
CurrentDir=directory()
CmdLine=translate(arg(1))
parse var CmdLine Parm1 Parm2
if Parm2<> "" then
do
DirToOpen=Parm1
ViewType=strip(Parm2)
end
else
do
if Parm1= "" then
do
DirToOpen=CurrentDir
ViewType= "ICON"
end
else
do
if Parm1<> 'ICON' & Parm1 <> 'TREE' & Parm1 <> 'DETAILS' then
do
DirToOpen=Parm1
ViewType= "ICON"
end
else
do
DirToOpen=CurrentDir
ViewType=Parm1
end
end
end
if length(DirToOpen)=3&substr(DirToOpen,2,1)= ':' & substr(DirToOpen, 3, 1) = '\' then
nop
else
do
TryDir=DirToOpen|| '\*.*'
TryDir=stream(TryDir, 'c', 'query exists')
if TryDir<> '' then
do
TryDir=left(TryDir,length(TryDir)-4)
if DirToOpen<>TryDir then
do
say 'Converting "' || DirToOpen || '" to "' || TryDir || '"'
DirToOpen=TryDir
end
end
end
call charout,'Opening ' || ViewType || ' view of "' || DirToOpen || '"'
if SysSetObjectData(DirToOpen, 'OPEN=' ||ViewType)=1 then
do
say ', OK'
exit(0)
end
else
do
say ", " || Red || 'Failed...' ||Reset
exit(219)
end