home *** CD-ROM | disk | FTP | other *** search
- /*
- * A sweep command for OS/2
- * Recurses through directories from default and executes a command line
- * Freeware by M. Kimes
- */
-
- '@echo off'
- parse arg cl
- if cl = '/?' then signal givehelp
- if cl = '?' then signal givehelp
- if cl = '-?' then signal givehelp
- if cl = '' then signal givehelp
- n = setlocal()
- call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
- call SysLoadFuncs
- dummy = charout(,'Working...')
- rc = SysFileTree('*',filename,'DS')
- dummy = charout(,'0d'x)
- dummy = charout(' ')
- dummy = charout('0d'x)
- if rc = 0 then
- do
- do i = 1 to filename.0
- parse var filename.i fdate ftime fsize fattr fname
- fname = strip(fname,'b')
- newdir = directory(fname)
- if newdir = fname then
- do
- if cl \= '' then
- do
- say '['fname']: 'cl
- cl
- end
- end
- end
- end
- n = endlocal()
- exit
-
- givehelp:
- say 'SWEEP.CMD'
- say ' Performs a command in all subdirectories of the current directory.'
- say ''
- say ' Usage: Sweep command'
- say ''
- say ' Examples: Sweep DEL *.BAK'
- say ' Sweep COPY *.TXT D:\BACKUP'
- say ' Sweep FOR %D in (*.MAK) DO NMAKE /A /F %D'
- say ''
- say 'Hector wuz here.'
- exit
-