Results 1 to 19 of 19

Thread: what to type to search all files?

  1. #1

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    what to type to search all files?

    Hi is there any easy way to search all files?


    like
    Code:
    strExtension = "*.TXT"
    
    'but instead i wanna search for all files like txt and exe and doc and so on...
    'I thought of *.* as u do in cmd controle. 
    'But i didnt get it to work anyone knows how to Search For All Files. 
    'I allready got everything else so right now i can If said search for .txt or if said .Doc but not if i wanna search for every file can find...
    Last edited by goofan; Nov 18th, 2009 at 05:19 AM.

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: what to type to search all files?

    Your question is not clear to me...

    What code are you using...????
    Is it VB6...???

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: what to type to search all files?

    my question is i got a search engine.... and in it i set extension to be "either .txt or other by using radiobuttons. What i want is to have a radiobutton so i can search for all extensions...

    In CMD its called *.* then u search all extension (if i remember correctly)


    i hope u understand

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: what to type to search all files?

    Will this help you...???
    http://www.devx.com/vb2themax/Tip/19058

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  5. #5
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: what to type to search all files?

    The above code allows wildcard searches...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  6. #6

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: what to type to search all files?

    code for the dir opening and such is:



    Code:
    strmessage = vbCr & "" & dirdialog.path
    
    If right(fildialog.path, 1) = "7" then
    
    strmessage = fildialog.path & fildialog.filename
    
    Else
    
    strmessage = fildialog.path & "/" & fildialog.filename
    
    End If
    
    
    
    Folderpath = strmessage
    
    
    
    
    
    If option1.Value = true then
      strExtension = "*.Txt"
    'more of these'
    end if ..... thats what i can sow u =) i want the 
    If option1.Value = true then
      strExtension = "*.Txt"
    to be like 
    If option1.Value = true then
      strExtension = "*.*"
    'searching all files'
    but i dont know what i need to code to see all the files.

  7. #7

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: what to type to search all files?

    hmm i cant really get that into my coding...

  8. #8
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: what to type to search all files?

    Quote Originally Posted by goofan View Post
    code for the dir opening and such is:



    Code:
    strmessage = vbCr & "" & dirdialog.path
    
    If right(fildialog.path, 1) = "7" then
    
    strmessage = fildialog.path & fildialog.filename
    
    Else
    
    strmessage = fildialog.path & "/" & fildialog.filename
    
    End If
    
    
    
    Folderpath = strmessage
    
    
    
    
    
    If option1.Value = true then
      strExtension = "*.Txt"
    'more of these'
    end if ..... thats what i can sow u =) i want the 
    If option1.Value = true then
      strExtension = "*.Txt"
    to be like 
    If option1.Value = true then
      strExtension = "*.*"
    'searching all files'
    but i dont know what i need to code to see all the files.

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  9. #9

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: what to type to search all files?

    that is where i select what kind of extension i need (at the end of the code ure quoting)

  10. #10

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: what to type to search all files?

    tell me what u need explained or if u dont understand something

  11. #11
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: what to type to search all files?

    Did you find any error while using *.* ?

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  12. #12

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: what to type to search all files?

    well as i use *.*
    it only opens .txt files! :?) and i dont know why no error nothing it just opens "only" .txt for some reason
    Last edited by goofan; Nov 25th, 2009 at 04:50 AM.

  13. #13

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: what to type to search all files?

    ohh never mind i dont know why it aint showing the others but i know why it shows the txt...



    .:.Ok my problem.:.
    as i type in sand into my search box and tells it to search *.* it will look into every file it opens however it dont seem to open .doc for some reason and i know it sais sand in the .doc aswell as i typed it in just before.

  14. #14
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: what to type to search all files?

    Ok... So you are saying that you can't find the word you are searching, on MS Word files... ???

    Do one thing... Open your MS Word document using Notepad (right click the file, then in Open With menu, choose Notepad )

    Did you see the word.... ???
    MS Word files are different from text files....

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  15. #15
    Addicted Member
    Join Date
    Jul 2007
    Posts
    228

    Re: what to type to search all files?

    There are many filetypes that use proprietary formats. This includes MS Word, WordPerfect, PDF Format and others. Even if you are able to open these documents in a binary mode and read the contents into a string doesn't mean you will find the Ascii text in that binary string. Frequently it will look like mumbo-jumbo.

    The above post is correct. Open a .doc or .pdf file in Notepad and then search for the word. Chances are you will not find it.

    To accurately search a proprietary format you'll need to convert it to text or use com object to open a file and search.

  16. #16

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: what to type to search all files?

    ok so i cant open it normally but how do i convert it? i need to be able to search throught all files!.
    isnt there some kind of aplication or code that makes it possible to search all files with "any" extension.



    -Thanks in advance
    -Thomas

  17. #17
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: what to type to search all files?

    Will this help you..???
    Click Here

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  18. #18

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: what to type to search all files?

    well i cant download anything as the work computer, the local server dont allow it. And then i dont really know (as i couldn´t download it) if the program where the application itself. What i ment when i said "is there any aplication or code..." was lika a API within Vb 6.0. Like an
    addon sort of function.

    Are u possible to show me a part of a code that solves this problem? (just so i can modifie it myself)

    -Thanks in advance
    -Thomas
    Last edited by goofan; Nov 24th, 2009 at 04:15 AM.

  19. #19
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: what to type to search all files?

    Quote Originally Posted by goofan View Post
    ok so i cant open it normally but how do i convert it? i need to be able to search throught all files!.
    isnt there some kind of aplication or code that makes it possible to search all files with "any" extension.
    There is code... but it can be very complex, and you need different code for almost every file type you want to work with.

    For example, to read an Excel file (.xls or .xlsx etc) the easiest way by far is to use Automation, as shown in my Excel tutorial (link in my signature). Unfortunately this needs Excel to be installed - and it will only work for a small amount of file types.

    To read other MS Office based files, see the relevant articles in our Office Development FAQs (at the top of the Office Development forum)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width