Summary

Providing a scheduled application with access to network drives can be confusing to set up, partly because of the different way that NetWare and Windows NT network resources are treated by the operating system.

More Information

The following points should be kept in mind when using network drives.

System vs. User Account

Network connections cannot be established when running a program under the System account. Always specify a user account and password for your program if you need to use network drives.

Using Existing Network Drive Mappings

Programs run by the Scheduler generally will not have access to network drive letters unless those letters are mapped by the Scheduler (see next section).

This is because drive letter mappings (e.g., those assigned using Windows Explorer) are defined at the user level, not the system level. These drive mappings are only valid while the user who made them is logged into the computer interactively.

Even if you are running scheduled programs under an account for which drive mappings are defined, the programs will not have access to those mappings, because the Scheduler does not load them when it logs on to that user account.

For Windows Network resources, if you are running the job under a user account, and that user account is also logged into the computer interactively, the drive letters for that user account may be available to scheduled programs. However, you should not rely on this being the case, because your scheduled programs will then fail if the user is not logged in interactively, or if another user is logged in.

Instead you should always use UNC designations for network resources, or have the Scheduler map the drive letters.

Mapping New Drive Letters

When mapping drive letters to network resources, the Scheduler cannot use a drive letter that is already in use. For example, if drive F: is mapped to \\server\share1 as part of your interactive session, you cannot map that drive letter to the same or any
other network drive with the Scheduler. If you attempt to do so, you may receive an error similar to the following:

An error occurred while connecting F to \\server\share1 for program <program>. The program may not run correctly as a result. An attempt was made to remember a device that had previously been remembered.

If your program needs to refer to \\server\share1 using a drive letter, you must map an unused drive letter to it within the Scheduler.

Access to NetWare Resources

Due to Windows NT security features/limitations, a program run by the Scheduler does not have access to a NetWare drive unless that drive has been specifically connected to by the Scheduler. Specifically:

If your program refers to the drive by UNC name (e.g., \\server\share1), you must explicitly define this resource on the Network page. To do this, add a network resource that is not mapped to a drive letter. Be sure to specify a valid account name and
password.

If your program refers to the drive by drive letter (e.g., F:), that drive must be
mapped within the Scheduler. For example, you can use the Windows Explorer (or some other
mechanism) to map drive letter N: to the NetWare drive \\server\share1. This mapping will
be available to you during your interactive session. However, if an application run by the
Scheduler attempts to use drive N:, it will report an error such as

Invalid Path or File Name

If your program needs access to \\server\share1, you must explicitly map it to a
different drive letter within the Scheduler.

Access to Windows Network Resources

In contrast to NetWare resources, scheduled programs can access network resources by
UNC name without specifically defining those resources in the Scheduler, provided that:

  • You have scheduled the program to run under a valid user account.
  • The account has permission for the resource you are trying to use.

For example, your program can read the file "\\server\share1\somefile.txt"
even if you do not define this network resource in any way on the Network tab.

However, if your program needs to refer to the network resource using a drive letter,
the same restriction applies as for NetWare resources: if your program refers to the drive
by drive letter (e.g., F:), that drive must be mapped within the Scheduler. For example,
you can use the Windows Explorer (or some other mechanism) to map drive letter N: to the
NetWare drive \\server\share1. This mapping will be available to you during your
interactive session. However, if an application run by the Scheduler attempts to use drive
N:, it will report an error such as

Invalid Path or File Name

If your program needs access to \\server\share1, you must explicitly map it to a
different drive letter within the Scheduler.