Windows – Providing network drive access to a windows service

serviceshell-scriptingstartup-scriptswindows

I have a windows service, which requires access to a network drive.
As Windows Service does not perform interactive logon, it's not possible to use mapped drive from active directory user logon script.
Which would be the best – secure and elegant way to provide a network drive for such a windows service? A helper script? Or, is there any other solution?

/Windows 2008

Update:
Unfortunately, this services does not allow to use UNC path, otherwise we would gladly use our domain shares.

Access to a network share is our requirement. Service is able to use shares mapped to a letters. It's not the most elegant way, though.

Best Answer

As drive letters are ephemeral, it would be best to use UNC paths instead of drive letters. If the service is unable to handle UNC paths, consider creating a symlink to the destination like

mklink c:\remotenetdir \\server\remote\netdir

and use the local path (c:\remotenetdir) in the service configuration.

Obviously, the service account would need to have the permission to access \\server\remote\netdir for this to work.