home *** CD-ROM | disk | FTP | other *** search
- /*WHERE.CMD (c) C.BLACK, B.STONE, KUTEK 1992,1993*/
- /* from ***BLKOS2*** */
- /*all rights reserved*/
- /*Final standalone version*/
- /* may not be bundled or sold,use at your own risk*/
- /* This copyright notice may not be removed*/
- /*if you upload this elsewhere*/
- /*KUTEK PO BOX 261 Forked River, NJ 08731*/
- /*USAGE: wh <path/filename> <opt start drive><opt drv type><]> <]]>*/
- /*type where.cmd ? at the prompt for help*/
- /* this pgm is free for individual users.It is an introduction to the */
- /*functionality of the upcoming BLKOS2 and the BACKSTONE SHELL*/
- /* there are no name dependencies in this pgm -call it anything you like.*/
- /*requires either rexx20 update, the service pak or OS2 2.1*/
- /*THIS PGM WILL LOAD THE REXXUTIL FUNCS IF NOT LOADED*/
- /* BUT IT DOES NOT UNLOAD THEM*/
- '@echo off'
- ttestt= rxfuncquery(sysloadfuncs)
- if ttestt=1 then do
- call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
- call sysloadfuncs
- end
- ansi1=x2c(1B)'[1;31m'
- ansi2=x2c(1B)'[1;32m'
- ansi3=x2c(1B)'[1;33m'
- ansi66=x2c(1B)'[1;36m'
- ansi0=x2c(1B)'[0;m'
- ind=0;aa=0;diu=0;flok='b'
- arg nn pp
- if nn='?' then call info
- if wordpos(']',pp)\=0 then diu =1
- if wordpos(']]',pp)\=0 then flok='d'
- parse var pp hh ll mm oo
- bb='*USED*LOCAL*REMOTE*'
- if ll='' then ll='USED'
- if hh=''|hh=']'|hh=']]' then hh='C:'
- if pos(hh,bb)\=0 then do;ll=hh;hh='C:';end
- if ll=']'|ll=']]' then ll=''
- if mm=']'|mm=']]' then mm=''
- parse value systextscreensize() with kl km
- call syscls
- dd=syscurpos(5,0)
- if pos(':',nn)\=0 then call sing
- dri=sysdrivemap(hh,ll)
- if dri='' then do
- say ansi1 'NO' ll 'DRIVE(S) AVAILABLE' ansi0;exit;end
- else say ansi2 'SEARCHING DRIVES' ansi3 dri ansi2 'FOR' ansi66 nn ansi0
- ne=0
- do until dri=''
- ne=ne+1
- parse var dri djd.ne dri
- end
- do i= 1 to ne
- onetime:
- ready=sysdriveinfo(djd.i)
- if ready='' then do
- say ansi1||'DRIVE' djd.i 'NOT ACCESSIBLE'||ansi0
- if ind=1 then exit
- else iterate
- end
- else
- dr=sysfiletree(djd.i'\'nn,vt,(flok)s)
- if vt.0\=0 then do f=1 to vt.0
- aa=aa+1
- kill.aa=vt.f
- end
- if ind=1 then call list
- end
- if aa=0 then do
- no:
- say ansi1 'OBJECT' ansi66 nn ansi1 'NOT FOUND' ansi0
- exit
- end
- else do
- list:
- if diu\=1 then say ansi2 aa 'OBJECT(S) FOUND' ansi0
- nbn=0
- if aa\=0 then do j=1 to aa
- nbn=nbn+1
- if diu=1 then do
- parse var kill.j d1 d2 d3 d4 d5
- say d5
- end
- else say ansi66 kill.j ansi0
- if nbn=kl-6&diu\=1 then do
- pause
- nbn=0
- end
- end
- if aa=0 then call no
- exit
-
- sing:
- ind=1
- parse var nn dj +2 nn
- i=1
- djd.1=(dj)
- say ansi2 'SEARCHING DRIVE' ansi3 dj ansi2 'FOR' ansi66 nn ansi0
- call onetime
-
- info:
- call syscls
- poss =syscurpos(5,0)
- say ansi66||'USAGE: WHERE <drv:filename> <opt start drive> <opt drv type> <]> <]]>'
- say
- say 'Example: where c:cmd.exe a: LOCAL ] (note:no backslashes used)'
- SAY
- say ansi3||'OMITTING drv SPEC SEARCHES ALL DRIVES STARTING AT C:'
- say
- say '<DRIVE TYPE> CAN BE ONE OF FOLLOWING:'
- say 'USED,LOCAL,REMOTE'
- say
- say 'START DRIVE PARAMETER MUST HAVE COLON eg. F:'
- say
- say '<]> PARAMETER DENOTES NON STOP LIST OF PATH/NAME RESULTS ONLY'
- say
- say '<]]> PARAMETER DENOTES DIR ONLY LISTING'
- say
- say 'CASE IS IRRELEVANT,WILDCARDS ARE ALLOWED IN FILE SPEC'
- say
- say 'TYPING SOMETHING LIKE <name>* AUTOMATICALLY COMPLETES <name>'
- say
- say ansi2||'TYPE INPUT SPECS NOW OR HIT ENTER TO EXIT'||ansi0
- pull nn pp
- if nn='' then exit
- return
-
-
-
-
-