Jump to content
Compatible Support Forums
Sign in to follow this  
ron_bakker00

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

Recommended Posts

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

Share this post


Link to post

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

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×