KB Article #177229

When Transfer CFT is started as a Windows service, UNC paths are not available

Problem

When Transfer CFT is started as a Windows service, UNC paths are not available

DIAGI=102 trying to access a file from the UNC server

Resolution

A UNC server, that works when from the user session (so the user is authorized to that server) may not work as is for the application launched from a Windows service (and this, even if the userid set for the service is the same as the one that have access from a windows session).

For Windows service, UNC servers must be registered so they are available to the system without the need of opening a session.

There is several ways to achieve this, and same precautions are needed if you need to have a mapped drive to that UNC path available to the application.

Steps that work:

Get the system set for permanent access to the UNC server by launching as admin the command rundll32.exe keymgr.dll, KRShowKeyMgr

Next, if needed, map drives at system start (or at least, before service starts)

In all cases, the USER must be authorized, the UNC server must be known by the system before the service starts and the mapped drive must be available before the service starts.

The way to do it is probably not unique. (and it is the customer responsibility)


Also, when a permanent mapped drive is needed, you can do one of the two solutions below: (the UNC server need to be registered already from steps above)


1) Using Windows Sysinternals, log in as the NT AUTHORITY\SYSTEM account:

psexec -i -s cmd.exe (This launches a new command window)

Then, create the persistent mapped drive.

net use Z: \\servername\sharedfolder /persistent:yes

And provide the credentials for a user having access to the shared folder.


2) Add a scheduled task and insert "system" in the "run as" field. Point the task to a batch file with the map command:

net use Z: \\servername\sharedfolder /persistent:yes

Then select "run at system startup" and you are done.