Need Help - Finding program directories

tris
10-04-2001, 03:43 AM
Heres the deal.

I am using the following code to copy a file from my application directory to watever location is stored in a string variable called copy_to_path. At the moment, i have hardcoded the value of this string to the desktop.

Dim Copy_To_Path As String

Copy_To_Path = "C:\WINDOWS\Desktop\NorthwestNews.prc"
FileSystem.FileCopy App.Path & "\..\northwestNews.prc", Copy_To_Path
Exit Sub

What i need to do is find the directory for a specific program.
In this case, i need to find where a program called 'Palm Desktop' has been installed, so that the .prc file is copied into the 'Palm Install Directory'.
Therefore, does anyonme know how to find the location of a program or possible how to find a full pathname using only a part of one e.g \Palm\Install

Hope this isnt too confusing, but i am a little confused abaout the whole thing myself!

Tris


<font color=blue>Only one thing in life is certain - you won't get out of it alive </font color=blue> images/icons/cool.gif

pratim_g
10-04-2001, 04:14 AM
Hi,
Actually, my colleague had also encounterd the same kind of problem. It can be done using API. Like what i get from your question is you need to find a specific program and then put your file there. It will be like using the find file dialog box ..right.
Please messgae me if this is what you want so I can send you the source code for this
Thanks...

Banjo
10-04-2001, 04:25 AM
Using Regedit, search your registry for the install path and then in your program use that Key, path and value info to read the install path on the target machine.

tris
10-04-2001, 04:35 AM
Both of those methods sound great.
Could you both send some source code on how you would do it.

Thanks alot

Tris

<font color=blue>Only one thing in life is certain - you won't get out of it alive </font color=blue> images/icons/cool.gif

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum