Discussion Locked

Please Help: Creating a Search Box

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am a new to programming and my boss thinks because I know how to take care of the network I can write code as well. He purchased Visual Basic.Net Standard. Told me I had a deadline today to create an executable file that will search a workstation for all files with a .doc extension. But the search results will only show the filenames searched with a .pdf extension. So, it should work and look like windows search box with the above exception. If I type find *.doc it will not display all files with .doc extension but all files with .pdf extensions. Why? I have no idea but if I fail to complete this today I am in trouble. I have beat my head into the wall for 13 hours yesterday and failed. Can anyone please help?

Thank you very much in advance for any help,
Carl Johnman
carlj@zuzolo.com

2 replies

by weberjg

I recommend you check the microsoft knowledge base article 185601: HOW TO: Recursively Search Directories by Using FileSystemObject

This applies to VB6 professional edition. There is surely the equivalent in VB.net.

You may need to use the .getdrive function for the C drive and the .getfolder function for the subfolders.

I tried this using "*.doc" for the file name in the first DIR statement. This only returns one file name. You will need to recurse a DIR statement with no parameters to pick off the file names for the remaining .doc files in any folder.

by michal.woznicki

I could not help but ask WHY WHY WHY WHY WHY? And I believe that you should be asking your boss the same thing. Unless of course your boss is testing your programming skills and the little trick of searching for PDF when DOC is entered is so he knows that you understand what to change and where. i.e. That you haven't ripped of a generic search from somewhere.

The first answer has it all as the programming is the same for VB 6 VB.NET as far as Searching the file directory structure goes. Good Luck

This discussion is closed to new replies.