473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

application path of a service

Hello everyone,

This is probably a very simple and stupid question, but I cannot seem to
find the answer to it. How do I obtain the path of a windows service's
executable file? The Application.StartupPath does not work of course, since
the system.windows.forms assembly is not loaded. I tried
Environment.CurrentDirectory and System.IO.Directory.GetCurrentDirectory,
but they echoed the system32 directory.

Thanx,

Dmitry
Nov 20 '05 #1
2 2233
Hello,

"Dmitry Akselrod" <dm*****@ddi.com> schrieb:
This is probably a very simple and stupid question, but
I cannot seem to find the answer to it. How do I obtain
the path of a windows service's executable file?


Maybe 'System.Reflection.Assembly.GetExecutingAssembly() .Location' works
(untested).

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
That worked like a charm. Thank you so much!

Dmitry

"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:eO***************@TK2MSFTNGP12.phx.gbl...
Hello,

"Dmitry Akselrod" <dm*****@ddi.com> schrieb:
This is probably a very simple and stupid question, but
I cannot seem to find the answer to it. How do I obtain
the path of a windows service's executable file?


Maybe 'System.Reflection.Assembly.GetExecutingAssembly() .Location' works
(untested).

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Keith | last post by:
All, I have been told this is an ASP.NET issue and not an IIS issue, so I am posting this here. I have a problem with ASP.NET returning an HTTP 500 error when trying to run ASPX pages on...
5
by: Martin Robins | last post by:
I have never dabbled with ASP.NET until now so be warned! I have created a web application with the single default form: WebForm1.aspx and when I try to display it I get this error. My...
2
by: Ross | last post by:
Hi I have an application using asp.net that I am running on my PC. The web form has a text box where you can enter a name for a new Photo category then click on the button. The code is...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
1
by: Zachariah | last post by:
I created a Windows Service and part of its functionality is to move a PDF file from a location on the service's local drive stInPath (C:\PDF\) to a location on another server stOutPath...
13
by: Nak | last post by:
Hi there, In VB6 if I wanted to make a shared application so to speak I would create an ActiveX EXE. This would allow me to expose objects of the application but only have 1 instance loaded. ...
4
by: Ray | last post by:
Does anyone out there have experience with using Db2 8.2 with a program called MISys (also known as ACCPAC). I am having some problems with the application running exteremly slow on workstations...
12
by: Martyn Fewtrell | last post by:
Hi there I'm trying to find the correct way to write exceptions to the Application log using Vb.Net. I've done a fair bit of Googleing and although this gets plenty of mentions and that this...
2
by: loga123 | last post by:
Hi All, I have 2 web applications running on the same IIS server with different roots. Suppose, application A can be run using --http://localhost/A application B can be run using...
4
by: =?Utf-8?B?S2lt?= | last post by:
Hey All I know how to to get the service ( by RegistyKey and Registy) so I can start the Application by dobble ckich on the file, but how can I read (and save) the path to the file so I can save...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.