471,348 Members | 1,358 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 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 8212
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Dmitry Akselrod | last post: by
8 posts views Thread by jcrouse | last post: by
1 post views Thread by Sean | last post: by
1 post views Thread by David B Stinson | last post: by

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.