With this capability, you can share a drive, then map any or all of the folders on that drive. However, you need to be exceptionally judicious about security in such cases. I use this technique only in test lab scenarios that provide a controlled environment (i.e., a discrete LAN on a hub that's unconnected to the rest of the enterprise and on which I either run a firewall or eliminate Internet access). After I share drive C of each computer that's on the LAN, I can remotely access any folder on those drives. For example, to access the LabData folder on the C drive of the TestBox server in my lab, I can type
net use d: \\TestBox\C\LabData
I can then perform any task that involves a remote folder. For example, I use mapped drives to perform backups across the network; for details, see the sidebar "Using Mapped Files for Backups."
Administrators can use the Net Use command within logon batch files to set mapped drives for users so that they can easily access frequently used folders on remote systems. For example, for users who work with the company database, you might have a logon script that contains the following lines:
net use g: \\BigServer\OurDatabase
net use h: \\BigServer\DatabaseFiles
Name the batch file whatever you want (be sure it has a .bat extension), and copy it to the logon script directory on your domain controller (DC). The default location for logon scripts on a Win2K DC is %SystemRoot%\SYSVOL\sysvol\domain name.com\scripts. Win2K automatically shares the scripts subfolder with the share name Netlogon.
Be very careful not to map the drive letter assigned to user home drives. During user logon, Windows maps the home drive before running logon scripts from the scripts subfolder. If your logon script tries to map a drive letter that's already used, the system returns the message The local device name is already in use.
Automatic Disconnection of Mapped Drives
Sometimes, when a user opens My Computer or Windows Explorer, a red X appears on the mapped drive's icon, indicating that the drive isn't available. Windows automatically disconnects mapped drives after a period of inactivity (the default interval is 15 minutes) and displays a red X on the drive's icon. When that happens, clicking the icon or entering the drive letter followed by a colon (:) at the command prompt automatically reconnects the drive. But the red X also appears if the computer that holds the mapped share isn't available for some reason, in which case these steps don't work. Because users can't tell why the red X appears, they often call the Help desk.
You could cut down on those Help desk calls if you could disable the automatic disconnection of mapped drives so that users see a red X only when a remote computer is down. The Autodisconnect registry value controls the automatic disconnect. According to Microsoft, you can disable this function by setting Autodisconnect to -1. However, the registry won't let you enter a minus sign for this value. Some Microsoft support technicians suggest entering
net config server /autodisconnect:-1
at a command prompt. Although this command appears to enter a value of -1 for the Autodisconnect registry value, it actually changes the value to the maximum supported value, which is 4,294,967,295 minutes (more than 8000 years) for Win2K Professional and 65,535 minutes (more than 45 days) for Win2K Server. Both values are large enough to effectively disable the autodisconnect function. However, the Net Config command also changes two other subkey values, and these additional changes (which affect browser announcement schedules) might cause other problems.
Some administrators try changing the Autodisconnect value to 0. However, a 0 value doesn't prevent automatic disconnection of mapped drives. Rather, this value has the effect of disconnecting drives erratically and often quite quickly.
The best approach is to explicitly set Autodisconnect to the maximum supported value. Start a registry editor (e.g., regedit.exe) on the computer that holds the share (not the remote computer that maps the share). Navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters subkey, and double-click the Autodisconnect registry value. If the computer on which the share resides is a Win2K Pro workstation, enter a new decimal value of 4294967295 or a new hexadecimal value of ffffffff. If the computer is a Win2K server, enter a new decimal value of 65535 or a hex value of 0xffff.