473,378 Members | 1,368 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,378 software developers and data experts.

Application.StartupPath for windows service

I have a C# windows service. How can I determine the start up path for the
service? The default current directory when the service starts is
\windows\system32. The Application.StartupPath for a normal windows program
does not seem to be available from a service program. Any help is greatly
appreciated.
Jul 21 '05 #1
1 8445
Try

private string StartPath
{
get {return
Path.GetDirectoryName(System.Reflection.Assembly.G etExecutingAssembly().GetName().CodeBase).Substrin g(6);
}
}
"David B Stinson" <Da***********@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
I have a C# windows service. How can I determine the start up path for the
service? The default current directory when the service starts is
\windows\system32. The Application.StartupPath for a normal windows
program
does not seem to be available from a service program. Any help is greatly
appreciated.

Jul 21 '05 #2

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

Similar topics

3
by: Dmitry Akselrod | last post by:
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...
5
by: Eranga | last post by:
In c# windows applicatiopns the Application.StartupPath can be used to find the path for the executable file. How can the same be found for a console application?(we can't use application because...
8
by: jcrouse | last post by:
I am trying to run a command from a command prompt using the shell command. Here is the syntax I want to execute: Shell(lblMameExePath.Text & " -listinfo >" & Application.StartupPath &...
2
by: Mario | last post by:
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...
1
by: Sean | last post by:
Hi I created a VB.NET console app. I try to use the Application.StartupPath() but got an error: Name 'Application' is not declared. Any idea? Thanks. Sean
1
by: David B Stinson | last post by:
I have a C# windows service. How can I determine the start up path for the service? The default current directory when the service starts is \windows\system32. The Application.StartupPath for a...
3
by: hayworth | last post by:
I had some code to build the name of a file: ' Build the name of the XML config file. g_strFiles.strConfig = My.Computer.FileSystem.CombinePath(Application.StartupPath, "\Settings\Config...
2
by: Mark | last post by:
I just discovered that the Application object is not available in the Windows service application. Is there any way to access properties such as StartupPath in Windows service application? Thanks...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.