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?