Wednesday, August 1, 2007

Drives mapped using Startup script or schedule task are not available.

Here are the steps to reproduce.

  1. Map a network share to a drive letter using schedule task that fires at System Startup.
  2. Using the same login credentials create another schedule task to copy a file from local drive to the mapped drive.
  3. Set the above schedule task to fire at any specific time.
  4. The 'copying' task would not be able to see the mapped drive. Although both the schedule tasks are running with the same login credentials.

The above is also true for Windows services. Mapped drives are not available to windows services, so it is best to use UNC paths in Windows service code, if required.

The following MS article explains this behavior.

http://support.microsoft.com/kb/180362/en-us

"-In Windows 2000, mappings to specific drive letters are globally accessible as long as the ID used has appropriate permissions." "-In Windows 2003, each individual login session has its own individual drive mappings that are not accessible to other users OR even to the same user in a different login session. In this case, one session is invoked by the first scheduled task, and another by the second, so they would not be able to share the drive mappings."

"On Windows NT and on Windows 2000, drive letters are global to the system. All users on the system share the letters A-Z. Each user does not get their own set of drive letters. This means a user can access the redirected drives of another user if they have the appropriate security access."

-------------------End of Document -------------------------

Tags: Windows Server 2000, Windows Server 2003

Published Date: 20080801

No comments: