Bokkie Posted March 2, 2006 Share Posted March 2, 2006 Guys, first post, and congratulations to the authors for an amazing product! For my first post I need to be able to search through all drives looking for a file that could literally be anywhere. The motiviation for doing this is that I need to run some MSDE database scripts but I need to check if there is an instance of MSDE and the database already created. I use InstallShield and it has an automatic search facility that will scan all local drives for a file and you can optionally set the maximum depth of directories it is to scan through. I can't rely on a registry search and the database I'm looking for could be on any local HDD, and the directory name of the MSDE instance is not necessarily the same for all installations. Is this possible in AutoIT? Link to comment Share on other sites More sharing options...
Confuzzled Posted March 2, 2006 Share Posted March 2, 2006 (edited) Guys, first post, and congratulations to the authors for an amazing product!For my first post I need to be able to search through all drives looking for a file that could literally be anywhere. The motiviation for doing this is that I need to run some MSDE database scripts but I need to check if there is an instance of MSDE and the database already created. I use InstallShield and it has an automatic search facility that will scan all local drives for a file and you can optionally set the maximum depth of directories it is to scan through.I can't rely on a registry search and the database I'm looking for could be on any local HDD, and the directory name of the MSDE instance is not necessarily the same for all installations.Is this possible in AutoIT?Welcome to the forums! AutoIT is powerful and will certainly do what you have outlined.Your problem needs nested loops.You will need to do something like this (pseudocode):Find all drives-For each drive--Find all folders/subdirectories--For each directory---Find file----If found, do something---Next file--Next directory-Next folderNext driveYou either found it or you didn'tIf you did,-Go do your database stuff.Else-Problem handlingFinishThe help file is your friend. Look in FileFindFirstFile, DriveGetDrive and see the associated links and examples. The beta versions of AutoIT are fairly stable, and contain a lot of additional functionality - I suggest you explore those.Searching these forums should also give you lots of examples where exactly this thing is done. You should have a look in the help file first however so you can understand what the various functions are.Good luck! Edited March 2, 2006 by Confuzzled Link to comment Share on other sites More sharing options...
Bokkie Posted March 2, 2006 Author Share Posted March 2, 2006 (edited) Thanks Confuzzled. I was researching the function reference and thought I'd have to do it the way you suggested. I was kind of hoping there would be an off-the-shelf function that would do it. Time to start coding (crack fingers)... I also noticed I can specify the type of drives I need to scan so I can restrict the search to just the local drives and not trawl across the network. Edited March 2, 2006 by Peter Hamilton-Scott Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now