program folder

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

How do I retrieve the path of the folder where the program is installed.

If the program is installed in c:\program files\myapp and is called from
d:\temp, the Environment.CurrentDirectory returns d:\temp. What do I call
to get c:\program files\myapp?
Thanks,
RickN
 
Hi,

Try:
Dim strPath as String = Application.StartupPath
.. or
Dim asm As System.Reflection.Assembly =
System.Reflection.Assembly.GetExecutingAssembly
Dim strAsmPath As String = IO.Path.GetDirectoryName(asm.Location)

Regards,
Josip Habjan
URL: http://www.habjansoftware.com
 
How do I retrieve the path of the folder where the program is installed.

If the program is installed in c:\program files\myapp and is called from
d:\temp, the Environment.CurrentDirectory returns d:\temp. What do I call
to get c:\program files\myapp?
Thanks,
RickN

Try Application.StartupPath

rossum



The ultimate truth is that there is no ultimate truth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top