Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. search files on hard drive by vb 6.0

search files on hard drive by vb 6.0

Scheduled Pinned Locked Moved Visual Basic
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ejaz_pk
    wrote on last edited by
    #1

    How can I search all the files available on my computer (C,D,E,F...) drives like search functionality in windows. The application should search the subfolder as well in the drives. I want to have a list of all the files available in my computer. Thanks In Advance

    L C 2 Replies Last reply
    0
    • E ejaz_pk

      How can I search all the files available on my computer (C,D,E,F...) drives like search functionality in windows. The application should search the subfolder as well in the drives. I want to have a list of all the files available in my computer. Thanks In Advance

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      That's going to be slooow.. The recipe first;

      • List all drives (Google for a snippet)
      • Create a recursive function to loop all folders in that drive
      • Proces all files and folders that the function returns

      ejaz_pk wrote:

      like search functionality in windows.

      That one allows you to search "within" files, and is more complex then the recipe above. Do you want to "list" all your files, or do you want to search their contents?

      I are Troll :suss:

      E 1 Reply Last reply
      0
      • L Lost User

        That's going to be slooow.. The recipe first;

        • List all drives (Google for a snippet)
        • Create a recursive function to loop all folders in that drive
        • Proces all files and folders that the function returns

        ejaz_pk wrote:

        like search functionality in windows.

        That one allows you to search "within" files, and is more complex then the recipe above. Do you want to "list" all your files, or do you want to search their contents?

        I are Troll :suss:

        E Offline
        E Offline
        ejaz_pk
        wrote on last edited by
        #3

        I just want file names list and path of the files.

        L 1 Reply Last reply
        0
        • E ejaz_pk

          I just want file names list and path of the files.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          The hardest part would be the recursive funtion to scan the folders. There's an example on that over here[^], and also on the Knowledge Base[^]. The rest is up to you :)

          I are Troll :suss:

          1 Reply Last reply
          0
          • E ejaz_pk

            How can I search all the files available on my computer (C,D,E,F...) drives like search functionality in windows. The application should search the subfolder as well in the drives. I want to have a list of all the files available in my computer. Thanks In Advance

            C Offline
            C Offline
            Chris Quinn
            wrote on last edited by
            #5

            Easily done by shelling to a DOS command that creates a text file, then parsing this if necessary: The following DOS command will create a file called Output.txt with a list of all files (not including system or hidden) on drive c: - the /s recurses subdirectories, and the /b restricts the output to filename only.

            DIR C: /s /b >Output.txt

            ==================================== Transvestites - Roberts in Disguise! ====================================

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups