Application.StartUpPath in a Windows service

  • Thread starter Thread starter Mario
  • Start date Start date
M

Mario

Hi,

I want to get the application startup path of a windows service which is
available with Application.StartupPath in the System.Windows.Forms
namespace.

Since we can not use this namespace in a service, what is the best way to
get the same information that is the path of the EXE for the service?

Thank you for your help,

Mario
 
* "Mario said:
I want to get the application startup path of a windows service which is
available with Application.StartupPath in the System.Windows.Forms
namespace.

\\\
Imports System.IO
Imports System.Reflection
..
..
..
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///
 
Thanks Herfried,

I will have to brush up on my research techniques... I did not look long
enough in the system.reflection class.

Mario

Herfried K. Wagner said:
* "Mario said:
I want to get the application startup path of a windows service which is
available with Application.StartupPath in the System.Windows.Forms
namespace.

\\\
Imports System.IO
Imports System.Reflection
.
.
.
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///
 
Back
Top