PDA

View Full Version : Locate installed version


bnkrazy
07-21-2005, 06:05 PM
Is it possible to search recursively up a directory tree?

For example, I download all my updates into a folder called %Program Folder%\Updates\%ProgramVersion%\

I know that I can easily find the installed version by either A) jumping up two levels in the directory tree via a relative path or B) recurse the current path back up the tree untill I find my installed product.

I just don't know how to go about scripting either of the two options. :o

Is there a snippet of code somewhere that does a reverse directory recursion? A way to strip off the current folder and then continue up the tree? It sounds like it should be easy, but I don't know how to manipulate that _SourceFolder Path...which is ultimately what I need to do.

Thanks!

bnkrazy
07-22-2005, 03:04 PM
Well, this isn't so much of an issue as the default script automatically checks the user's %Program Files%\%ProductName% directory. It should always find it based solely on that check alone... I also have it set to search all fixed disks if that fails, so I should be covered.

If I do figure out how to do it I will post the script here for all to see.