How to Find Files Fast Using DOS and Notepad
By on August 26th, 2009

Do you have a large hard drive? Mine isn’t very big, but I’ve still got over 90,000 files on it.

When I use Windows built in search tool to search for files, it seems to take ages for it to even start looking. It’s almost like the search tool wakes from a deep sleep and decides to start work after a cup of coffee. I can’t blame it, I feel the same way most mornings.

cn_findfiles_np_01

The solution I’ve come up with works for me and maybe it’ll work for you as well. It doesn’t require any tools that aren’t already on your Windows machine.

I wanted to search a network drive with over 600,000 files on it. Windows searches were taking up to half an hour to produce results. I was prepared to take a lunch break when I initiated a search.

I decided to fall back on my rusty old skills as a DOS batch file guru.

I wrote up a single line of text in Notepad with the following command on it where M: was the network drive I wanted to search.

DIR /B /S M:\*.* > C:\M_file_list.txt

cn_findfiles_np_02

Then I saved the file as a .BAT file in a handy location.

Double clicking the BAT file launched it. When I launch a batch file, it helps if I stand and pronounce this chant in a loud voice with both hands raised over the PC.

By the Power of DOS, I command you!

That really works best in a quiet room full of people who have no clue what I’m doing.

Fifteen minutes later, I had a text list that included the full path of all 600,000 files on the M: drive.

cn_findfiles_np_03

Now whenever I need to find a file, I open up the M_file_list text file and hit F3 or CTRL+F to open up the text search dialog.

Searching the text file is hundreds of times faster than Windows standard search was taking. The search takes around   5 or 10 seconds instead of half an hour. That does cut into my long lunch breaks, but we all have to sacrifice things in these hard times.

cn_findfiles_np_04

cn_findfiles_np_05

When I find the file I want, I copy the file path and paste it into the Start -> Run menu, to open the folder or the file itself.

cn_findfiles_np_06

Happy searching!

You can leave out the chanting if you have to.

Tags: , , ,
Author: Clif Sipe Google Profile for Clif Sipe
Promoting Freeware and Free information since 2004. Owner of FreewareWiki.com with over 2000 pages of freebies. Please subscribe to my Google Feed or follow me on Twitter @clifnotes.

Clif Sipe has written and can be contacted at clif@techie-buzz.com.
  • http://www.technostuffs.com Wilson Pon

    Honestly, I’ve over 150,000 files stored in my hard drive and it’s a painfully task to browse through it! Maybe this little trick is going to help me eliminate the hassle away. Thanks again, Clif.

  • Sriram

    Ultimate work. Thanks for the post.

    Sriram

  • http://clif-notes.blogspot.com Clif

    Thanks for the comment Wilson. I hope it does help you. If it doesn’t there are a few other tricks that I’m sure I and others here can recommend.

  • http://www.fortheloveofbeads.com/bead-store/glass-beads.html Glass Beads

    Thanks for this tip, I always like the MSDOS tags :)

  • http://www.ampercent.com Soumen Halder

    Great job Clif

    • http://www.google.com/profiles/clif.notes Clif Sipe

      Thanks Soumen, I appreciate the comment.

  • http://apathysoftworks.com John-Paul LaBorde

    Hey Clif~

    Stumbled upon this post and thought it was just great.
    Got bored and wrote a 30 min AutoHotKey script that will parse through the file you created and allow you to search within the lines in a listview GUI. In other words if you search for “ins” you will get all the lines displayed that have “ins” in them. Then you can right click and choose to run that line or copy it to the clipboard. I know there is Everything by VoidTools which is so much better, but like I said, I got bored. :)

    John-Paul
    apathysoftworks.com

    Here is the script:

    SetBatchLines, -1

    Width := 600
    Height := 600
    ;I have made the menu expandable. Just add the new commands you want delimited by `n with no spaces then create a new label with that name :)
    Menu_Items = Run_Line`nCopy_Line

    Loop, Parse, Menu_Items, `n
    Menu, CTX, Add, %A_LoopField%, OnMenu

    Gui, Add, Edit, vUser_Query w600
    Gui, Add, Button, gSearch, Search
    Gui, Add, ListView, w600 h600 vLV_Content gOn_LVEvent AltSubmit, File Lines
    Gui, Show, , Quick Find
    FileSelectFile, Loaded_File
    FileRead, File_Content, %Loaded_File%
    SplashTextOn, 200, 200, Parsing File, `nPlease wait a moment`n`nIf the file is big it could take a minute or two
    Gui, +Disabled
    Build_List(File_Content)
    Gui, -Disabled
    SplashTextoff
    return

    GuiClose:
    ExitApp
    return

    OnMenu:
    Goto, %A_ThisMenuItem%
    Return

    On_LVEvent:
    Line_Text =
    if (A_GuiEvent = “RightClick”)
    {
    MouseGetPos, X, Y
    LV_GetText(Line_Text, A_EventInfo)
    Menu, CTX, Show, %X%, %Y%
    }
    return

    Run_Line:
    StringReplace, Line_Text, Line_Text, `n, , All
    StringReplace, Line_Text, Line_Text, `r, , All
    Run, %Line_Text%
    return

    Copy_Line:
    StringReplace, Line_Text, Line_Text, `n, , All
    StringReplace, Line_Text, Line_Text, `r, , All
    Clipboard = %Line_Text%
    TrayTip, Copied!, %Line_Text%
    SetTimer, Tray_Off, -4000
    Return

    Tray_Off:
    TrayTip
    return

    Search:
    Critical
    Gui, +Disabled
    SplashTextOn, 200, 200, Parsing File, `nPlease wait a moment`n`nIf the file is big it could take a minute or two
    GuiControlGet, Query, , User_Query
    if (Query = “”)
    search_list := File_Content

    else
    {

    Loop,parse, File_Content,`n,%A_Space%%A_Tab%
    {
    Current_Line := A_LoopField
    tcount =
    tfound =
    loop, parse, Query, %A_Space%,%A_Tab%
    {
    if (A_LoopField = “”)
    return
    tcount++
    if instr( Current_Line, A_LoopField )
    tfound++
    }
    if (tcount == tfound)
    search_list .= Current_Line . “`n”
    }
    Current_Line =
    }
    Build_List(search_list)
    search_list =
    SplashTextoff
    Gui, -Disabled
    return

    Build_List(list) {
    global

    LV_Delete()
    StringReplace, list, list, `r, , All
    Loop, parse, list, `n,%A_Space%%A_Tab%
    {
    if (A_LoopField = “”)
    continue
    LV_Add(“”, A_LoopField)
    }
    LV_ModifyCol(1, “AutoHdr”)
    }

    • http://apathysoftworks.com John-Paul LaBorde

      Hmmm Just realized the script lost all formatting and changed ” to some odd character. Here I just uploaded the file on the site so you can copy it properly:
      http:\\apathysoftworks.com\temp\QuickFind.txt

      • http://www.google.com/profiles/clif.notes Clif Sipe

        Hi John-Paul – nice idea. Can you compile it and put it out as an EXE file for us to look at? I don’t keep AHK installed. I’ve used it, but never for long.

  • http://www.facebook.com/profile.php?id=100000477060361 Ridwan Mulyana

    Everything search engine.

    go to this link : http://www.voidtools.com/.

    it has many advantages :
    Small installation file.
    Clean and simple user interface.
    Quick file indexing.
    Quick searching
    Minimal resource usage.
    Share files with others easily.
    Real-time updating

 
Copyright 2006-2012 Techie Buzz. All Rights Reserved. Our content may not be reproduced on other websites. Content Delivery by MaxCDN