home *** CD-ROM | disk | FTP | other *** search
- echo off
- echo.
- echo ┌───────────────────────────────────────────────────────┐
- echo │ Searchstring find and count of file names on a device │
- echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, Sun 21-Oct-90 │
- echo └───────────────────────────────────────────────────────┘
- echo.
-
- if "%1"=="" goto _help
-
- rem Change the filename searchstring to upper case
- rem Credit should go where credit is due
- rem The idea of using path for the upper case conversion is from the
- rem PC Magazine. This code, however, is entirely my own (un)doing :-)
- set _stash=%path%
- path %1
- set _search=%path%
- path %_stash%
- set _stash=
-
- chkdsk /v | find "%_search%"
- echo Number of entries found:
- chkdsk /v | find /c "%_search%"
- set _search=
- goto _out
-
- :_help
- echo Usage: WHERE SearchString
- echo.
- echo E.g. WHERE where.bat finds all occurrences of where.bat on the device
- echo and WHERE .com finds all .com files
- echo but WHERE com finds all filenames which include the string "COM"
- echo.
- echo Contrary to the ordinary MsDos DIR convention this system
- echo matches the search string anywhere in the body of the filename
- echo.
- echo Do not use the wildcards * or ?
- echo They are not needed.
- echo.
- echo If you get an "Out of environment space" message, increase your
- echo environment space by using shell configuration in config.sys:
- echo Example: shell=c:\bin\command.com /e:1024 /p
- echo.
- echo.
-
- :_out
- echo on
-