home *** CD-ROM | disk | FTP | other *** search
- @echo off
- : Written by Robert Chung <chung@qal.berkeley.edu>
- : (Department of Demography, University of California, Berkeley).
- :
- : Displays a popup list of the files that match a certain search criterion,
- : then cd's to that subdirectory. Very useful for choosing among files with
- : extensions deemed executable, e.g., .DOC or .ZIP or .WK1.
-
- : (*) Files with .COM, .EXE, .BAT, and .BTM extensions will be executed.
- : (*) Files with user-defined executables will be handled one after the
- : other (the pop-up menu will pop up after each file) until you press
- : ESC.
- : (*) Files with no extension will cause switching to their subdirectory.
- :_________________________________________________________________________
-
- if "%1" == "" (echo Syntax is: WHEREFI filespecs^quit)
-
- set fn=%@unique[%_lastdisk:\]
- set srchdrives=C: D:
- rem ^^^^^ modify as needed.
-
- (for %drv in (%srchdrives) do (dir /sf %drv\%&)) > %fn
-
- iff %@lines[%fn] != -1 then
- goto pop_menu
- else
- echo.^echo No %@upper["%1"] files found on disk
- goto end
- endiff
-
- :pop_menu
- set cmdline=%@select[%fn,1,50,24,80, %& files ]
- iff .%cmdline != . then
- %@path[%cmdline]
- : the next 3 lines check for executable extensions
- if "%@ext[%cmdline]"=="" goto end
- if %@index[com exe btm bat,%@ext[%cmdline]] != -1 %cmdline
- if not "%[.%@ext[%cmdline]]" == "" (%cmdline^goto /i pop_menu)
- endiff
-
- :end
- del /q %fn
- unset fn
- echo.
- echo ==`>` %0 terminated
- quit