3

My C# based Wcf application hosted as windows service is unable to access mapped network drive even though it works with UNC path. I have come across the below article which states that it is not possible to use mapped drives with windows service.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms685143(v=vs.85).aspx

In my scenario I am logging into the service with a domain account & the same account is used to create the mapped network drive in the machine.

My company has all clients running the projects in mapped drives and they would want the service also to run and access the mapped drive configurations for pulling data.

In this scenario I am wondering if there could be a possible workaround given the situation that network drive would be created with the same account that the service is logged in with.

Any possible workaround or code fixes would be highly appreciated. Thanks .

battech
  • 733
  • 2
  • 10
  • 24
  • Did you read this? http://stackoverflow.com/questions/182750/map-a-network-drive-to-be-used-by-a-service?rq=1 – Steve Wellens May 14 '15 at 16:44
  • Ok . thanks for that . now i understand that to handle it in the windows service code is difficult. The workaround in my situation seems to be cumbersome. Reason is that the clients would always create a mapped network drive already in their local machine and even if i make them run the hack it would say "The local device name is already in use" – battech May 15 '15 at 13:19
  • In windows 7 , using net use z: /delete and net use z: \\servername\sharedfolder /user:username password will work for startup script. I want to make it work someway without having the client to enter password in the script file. Is there something that could be done ? – battech May 22 '15 at 06:27

0 Answers0