Windows Service and UNC Path Issues?

Aholics.com

Active member
Joined
Jun 15, 2004
Messages
27
Location
San Diego
Programming Experience
10+
Hi, I wrote a WinApp that successfully moves file around based on regular (D:\stuff\etc...) path and UNC (\\server\share\stuff\etc..) paths. No problem.

However, when I converted this app to a Windows Service, it no longer connects to the UNC path files. I assume this is a permission thing, as the Windows Service isn't logged in as a user.

So, the question is, how do I go about authenticating the Windows Service so that it can access files via UNC path?

Thanks!
 
Al,

You should be able to set the logon type to use assigned user credentials so you can impersonate a user. You should typically use the LocalSystem Account and see if that works first though (ServiceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalService).

Me.ServiceProcessInstaller1. (Account, Username, Password properties)...

HTH
 
I need to be able to enter multiple sets of credentials to do various forms of work on various systems. So, I figured out that programmatic Impersonation works just fine for Windows Services.

Thanks though!
AL
 
Back
Top