Accessing mapped network drives (Windows) from a JobScheduler Job
I'm trying to access a mapped network drive (e.g. X:) from a JobScheduler job. The drive can be accessed from outside JobScheduler but within a Job it doesn't exist.
This behavior is more of a Windows feature than a JobScheduler bug. On Windows JobScheduler runs as a service and services are started by a process which is started very early when the operating system starts up. That happens long before the network drives are mounted, which happens when a user logs on.
In order to access a network drive from JobScheduler, you need to mount it in the JobScheduler process. This can be done in the startup script of JobScheduler. In detail, do the following:
Make sure JobScheduler is running as a user that has permission to access the network drive(s) (Check the services configuration to set a different user).
Configure a scheduler start script to mount the network drive:
config/scheduler.xmlfile between the
Restart the JobScheduler
Note that this problem might have to do with the moment that the process which starts the services is started. If the environment variables do not yet exist, then they cannot be inherited by the services. See if it changes when you change the user that runs the service.