Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

File location with Windows Services ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike B - 11 Mar 2006 19:03 GMT
Is there a way to specify where support files are located for a Windows
Service?

I would like to have my service write and read it's files to/from a
different location than Windows\System32.

I would also like to have this location changed based on the where the user
requests that myservice.exe is placed.

Comments?
Dmytro Lapshyn [MVP] - 13 Mar 2006 15:29 GMT
Hi Mike,

It really depends on how you read the files, but you can probably always use
Assembly.GetExecutingAssembly().Location to determine the path where
myservice.exe resides.

> Is there a way to specify where support files are located for a Windows
> Service?
[quoted text clipped - 7 lines]
>
> Comments?
Mike B - 14 Mar 2006 04:18 GMT
Thanks very much for your assistance.

I found a way to do this. After the service is installed I have my service
application read the ImagePath entry from the Registry. I then use this to
read or write any files that are required by the service.

I still have to look into the suggestion made by  Dmytro of using
"Assembly.GetExecutingAssembly().Location".  Dmytro, thanks very much for the
response.

> Is there a way to specify where support files are located for a Windows
> Service?
[quoted text clipped - 6 lines]
>
> Comments?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.