Home » Questions » Computers [ Ask a new question ]

Windows xp command to search for files

Windows xp command to search for files

What is the easiest way to search for files from a command line on Windows XP?

Asked by: Guest | Views: 107
Total answers/comments: 2
Guest [Entry]

"This can be done with the built-in tools from command-prompt, although you will end up with scripts rather than simple commands. For an easy command-line approach for finding files that meet certain criteria, I'd install PowerShell.

Here are some examples to give you an idea:

to find files created since a certain date in the current directory:

C:\>Get-ChildItem | Where-Object{$_.CreationTime -gt ""28/12/2009 8:00:00 PM""}

Directory: Microsoft.PowerShell.Core\FileSystem::C:\

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 28/12/2009 3:56 PM 0 newfile.txt

to find a text file bigger than a certain size in the current directory (in bytes):

C:\> Get-ChildItem | Where-Object{$_.length -gt 16000}

Directory: Microsoft.PowerShell.Core\FileSystem::C:\

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 21/12/2009 7:02 PM 16504 svc.txt

to find all mp3 files on a different drive:

C:\> Get-ChildItem D:\ -include *.mp3 -Recurse -Force

Directory: Microsoft.PowerShell.Core\FileSystem::D:\

Mode LastWriteTime Length Name
---- ------------- ------ ----

-a--- 12/03/2009 4:01 PM 4418246 eric clapton - tears in heaven.mp3
-a--- 22/05/2009 2:24 AM 7714143 led zeppelin - stairway to heaven.mp3
-a--- 13/06/2009 2:39 AM 5507148 pearl jam - black.mp3
-a--- 13/06/2009 2:39 AM 3042452 pearl jam - last kiss.mp3
-a--- 31/12/2008 5:43 AM 3216613 rush - fly by night.mp3
-a--- 31/12/2008 6:37 AM 4267363 Rush - Limelight.mp3
-a--- 31/12/2008 6:02 AM 4224300 rush - yyz.mp3
-a--- 07/12/2008 2:05 AM 2827218 rush - closer to the heart.mp3
-a--- 19/05/2009 5:21 AM 5842779 styx - come sail away.mp3

Out of curiosity though, why can't Windows Search be used? It can do everything you require easily with a GUI."
Guest [Entry]

"Personal preference is to just get a copy of the unix find command ported to windows. 65k EXE file and in about the last 20 years I haven't come across anything it can't find based on the various switches and options. Then add the option to act on any file it finds, very useful. Too many examples to list here but check out


It can be found in the zip file found at http://sourceforge.net/projects/unxutils/"