Home

Jim Michaels

whereis for windows and dos

DOS version Uses UNIX style globbing (? to match single character, * to match 0 or more characters, [] for a regular expression character class or a range like [A-Z1357ab]), and VMS-style ... recurses into subdirectories.

Windows version uses -d to specify a single directory to start at and you can specify multiple files and ? and * are useable wildcards.

A list of paths is output in 2 columns: left hand column is the size in SI units, and the right hand column is the filepath.

license

This is under the GPL3 License.

dos version

Fri 07/22/2011 20:38:35.00|C:\prj\whereis\WHEREI~1.1|>dos\whereis -?
whereis - find files in specified subdirectories.
usage: whereis [-[-]?|/?|/h[elp]|-[-]h[elp]] [/v[er[sion]]|-[-]v[er[sion]]]
       whereis [[-]-d[ir[ectory]] dirpath] [-[-]SI|SI] [-[-]IEC|/IEC] file ...

All switches are case insensitive. disk numbers are integer64 as defined below.
finds all the path locations of filenames on the current drive.
-d dirpath specifies a base directory to start from.
-h or -help or --help or -? or no arguments gives this help.
-SI (the default) specifies SI units (K, M, G, T, P, E) in terms of powers of 1000.
-IEC specifies IEC Computer units (Microsoft style, Ki, Mi, Gi, Ti, Pi, Ei) in terms of powers of 1024.
? matches a single character
* matches 0 or more characters
use / in filepaths instead of \
you can specify as many directories as will fit on the command line.
example: whereis -d c:\t zippy.*  searches c:\t for files with basename zippy.
default is current directory (.\) if nothing specified.
example: whereis zippy.txt searches current directory for zippy.txt
copyright 2008,2009 Jim Michaels, under GPL3 license.

Fri 07/22/2011 20:39:24.84|C:\prj\whereis\WHEREI~1.1|>

example:
C:\prj\whereis\wherereis-1.1\dos>whereis \prj\...\whereis*
0.10B   \prj\whereis
0.16B   \prj\whereis\whereis-1.1
16.48KB \prj\whereis\whereis-1.1\dos\whereis.c
94.21KB \prj\whereis\whereis-1.1\dos\whereis.exe
0.51B   \prj\whereis\whereis-1.1\whereis.lsm
15.50KB \prj\whereis\whereis-1.1\win\whereis.cpp
77.31KB \prj\whereis\whereis-1.1\win\whereis.exe
22.59KB \prj\whereis\whereis-1.1\win\whereis.obj
393.22KB        \prj\whereis\whereis-1.1\win\whereis.tds
79.56KB \prj\whereis\whereis.zip

C:\prj\whereis\wherereis-1.1\dos>whereis \prj\...\whereis* \u\...\l50*
0.10B   \prj\whereis
0.16B   \prj\whereis\whereis-1.1
16.48KB \prj\whereis\whereis-1.1\dos\whereis.c
94.21KB \prj\whereis\whereis-1.1\dos\whereis.exe
0.51B   \prj\whereis\whereis-1.1\whereis.lsm
15.50KB \prj\whereis\whereis-1.1\win\whereis.cpp
77.31KB \prj\whereis\whereis-1.1\win\whereis.exe
22.59KB \prj\whereis\whereis-1.1\win\whereis.obj
393.22KB        \prj\whereis\whereis-1.1\win\whereis.tds
79.56KB \prj\whereis\whereis.zip
0.94B   \u\l50.ASM
0.66B   \u\l50.asm.debug
0.54B   \u\l50.co
0.03B   \u\l50.exe
2.32KB  \u\l50.lst

C:\prj\whereis\wherereis-1.1\dos>whereis \u\...\l\[25\]\[50\]*
1.06KB  \u\l25.asm
0.01B   \u\l25.co
0.03B   \u\l25.exe
0.94B   \u\l50.ASM
0.66B   \u\l50.asm.debug
0.54B   \u\l50.co
0.03B   \u\l50.exe
2.32KB  \u\l50.lst

C:\prj\whereis\wherereis-1.1\dos>

WINDOWS version

Fri 07/22/2011 20:19:04.84|C:\prj\whereis\whereis-2.1\win|>32\whereis
whereis - find files in specified subdirectories.
usage: whereis \[\-\[\-\]?|/?|\-\[\-\]h\[elp\]\]|/h\[elp\]\] \[\-\[\-\]v\[ersion\]|/v\[er\[sion\]\]\]
       whereis \[\[\-\]\-d\[ir\[ectory\]\] dirpath\] \[\-\[\-\]SI|/SI\] \[\-\[\-\]IEC|/IEC\] file ...

finds all the path locations of filenames on the current drive.
you can specify as many directories as will fit on the command line.
\-d dirpath specifies a base directory to start from.
\-h or \-help or \-? or no arguments gives this help.
? matches a single character
* matches 0 or more characters
example: whereis \-d c:\t zippy.*  searches c:\t for files with basename zippy.
example: whereis \-d c:\windows\system32 *.exe *.dll *.ocx  searches system folder for     executeables & ActiveX controls.
example: whereis zippy.txt searches current directory for zippy.txt
No copyright notice given, but I am putting one here nonetheless: directory walk
function Copyright 2000 Michael D. Ober, modified/fixed by Jim Michaels
Program Copyright 2008 Jim Michaels. under GPL3 license.

Fri 07/22/2011 20:19:27.32|C:\prj\whereis\whereis-2.1\win|>cd ..

Fri 07/22/2011 20:19:42.42|C:\prj\whereis\whereis-2.1|>win\32\whereis whereis.exe
 255.48K        .\dos\whereis.exe
  48.12K        .\win\32\whereis.exe
  46.59K        .\win\64\whereis.exe

Fri 07/22/2011 20:20:03.37|C:\prj\whereis\whereis-2.1|>win\32\whereis -iec whereis.exe
 249.51Ki       .\dos\whereis.exe
  47.00Ki       .\win\32\whereis.exe
  45.51Ki       .\win\64\whereis.exe

Fri 07/22/2011 20:20:10.79|C:\prj\whereis\whereis-2.1|>win\32\whereis -d \ -iec         whereis.exe
 221.51Ki       \cd\winUtils-stuff\3\whereis-2.0\dos\whereis.exe
 113.00Ki       \cd\winUtils-stuff\3\whereis-2.0\win\whereis.exe
  39.72Ki       \d\U\WHEREIS.EXE
  21.65Ki       \Documents and Settings\Jim Michaels\Desktop\4x3\5.25\4D\WHEREIS.EXE
      16.00Ki       \gnuwin32\GetGnuWin32\gnuwin32\bin\whereis.exe
 249.51Ki       \os\fdos\CDROOT\f\bin\3\whereis.exe
 249.51Ki       \os\fdos\CDROOT\f\whereis\whereis.exe
 221.51Ki       \os\fdos\CDROOT\f\whereis\whereis-2.0\dos\whereis.exe
 113.00Ki       \os\fdos\CDROOT\f\whereis\whereis-2.0\win\whereis.exe
 249.51Ki       \prj\whereis\whereis-2.1\dos\whereis.exe
  47.00Ki       \prj\whereis\whereis-2.1\win\32\whereis.exe
  45.51Ki       \prj\whereis\whereis-2.1\win\64\whereis.exe
 113.00Ki       \u\whereis.exe

Fri 07/22/2011 20:35:49.35|C:\prj\whereis\whereis-2.1|>