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
 
Back
Top