Reputation: 6616
in my windows service i can not create file in onStart
method give me an error
error In onstart method Access to the path 'C:\Program Files (x86)\Common Files\xxx\BridgeServiceLog.txt' is denied.
now how i can run my service as admin by code
Upvotes: 0
Views: 3544
Reputation: 6111
You can't elevate your own process. Additionally, since a service isn't intended to interact with the desktop a user wouldn't be shown any notices you prompt. You would need to adjust the user account your service is executed under.
Upvotes: 1