views:

140

answers:

1

I am attempting to programmatically FTP a backup file that is stored on a SAN device. The device has been mapped on the server. I tested the application by running it from an icon on the desktop and it works perfectly. When I run the program through a windows service I get an error message saying that the drive cannot be found. The account that the service was running under was the local account. I thought the issue might be that account so I created a new user and ran the service under that account. The same error message occurs. Has anyone experienced this before and found a resolution to this problem?

+3  A: 

The drive mappings exist only for the logged on user. For this reason they are not visible to the service as it runs on lower level. You need to use some ftp client if you want to use the storage location from a service.

The same problem appears with network shares where you cannot access a network share mapped to a network drives from services. The correct way to access these shares from a service is to use an UNC path similar to "\\SANS\Backuplocation".

Mikko Rantanen
Dear Mr. Rantanen,I have tired to use the UNC path that you mentioned in your answer. When I run the program by clicking on it the program works. when I run the program in a window service I get the error message Access to \\SANS\Backuplocation is denied". I have changed the account under which the service iw running, but that has not resolved the issue.