Compatible Support Forums: Windows Service (using SRVANY) is not able to acces network drive

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Windows Service (using SRVANY) is not able to acces network drive

#1 User is offline   ron_bakker00 

  • stranger
  • Group: Members
  • Posts: 1
  • Joined: 25-January 06

Posted 25 January 2006 - 04:40 AM

Hey,

I made a simple C program to write a file on a mapped network drive (which is in fact a local directory which I shared and mapped to S:). When I run this program as a user it is able to create a file ( as expected ). When I install the program as a service using srvinst.exe and srvany.exe it is no longer able to write on the mapped drive. When I try to write on the C: drive there is no problem. I tried several option to run the service with the administrator account but none was succesfull.
Does someone have a suggestion? Or an example how to write a windows service (using VC6.0) to avoid using srvany

Ron Bakker
0

#2 User is offline   pcaviness 

  • stranger
  • Group: Members
  • Posts: 1
  • Joined: 28-January 06

Posted 28 January 2006 - 06:20 AM

Windows 2000 and above creates a set of drive letters for each user. Services are not able to access these drives, unless a service running as local system maps the drive. Don't ask me, as Microsoft. The way we got around this issue was by using UNC paths (\\machine name\path). Another way is to create a service that maps your drives, must run as local system, or map the drive in your program. If you are using Microsoft Services for unix or MKS, you can mount the drive by typing mount <\\machine\path> <drive letter>.

Good Luck
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users