home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1996 February
/
PCWK0296.iso
/
sharewar
/
os2
/
narzedzi
/
fm2utils
/
where.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-06
|
1KB
|
62 lines
/*
* A where command for OS/2
* Finds (a) file(s) on a drive
* Freeware by M. Kimes
*/
'@echo off'
counter = 0
parse arg cl
if cl = '/?' then signal givehelp
if cl = '-?' then signal givehelp
if cl = '' then signal givehelp
parse upper var cl arg1 dummy
if arg1 = '/M' then
do
more = ''
parse var cl arg1 cl
end
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
dummy = charout(,'Working...')
rc = SysFileTree(cl,filename,'S')
dummy = charout(,'0d'x)
if rc = 0 then
do
if filename.0 \= 0 then
do
do i = 1 to filename.0
say filename.i
if more \= '' then
do
counter = counter + 1
if counter = 24 then
do
if i \= filename.0 then
do
dummy = charout(,'[More]')
dummy = SysGetKey('NOECHO')
dummy = charout(,'0d'x)
counter = 0
end
end
end
end
end
else say 'No matching files found.'
end
exit
givehelp:
say 'WHERE.CMD'
say ' Finds (a) file(s) on a drive.'
say ''
say ' Usage: Where [/M] mask'
say ' Where optional /M means "no more prompting."'
say ''
say ' Examples: WHERE \FM*'
say ' WHERE /M C:\OS2\*.INI'
say ''
say 'Hector wuz here.'
exit