How can I write a script that configures my Windows NT server to automatically map the home directory of Windows 9x users to the Z drive when they log on?
You typically use logon scripts to automate the task of mapping drives during logon. Logon scripts are batch files or other types of scripts (e.g., WSH) that run as part of each user's logon process. You can use logon scripts to not only map network drives but also map network printers and perform other client configuration tasks. Here are the general steps for creating and using a logon script:
- Create a batch file named logon.bat (or whatever name you prefer) that contains the commands to execute during the logon process. In your case, the batch file would include a command similar to
- Save the batch file to the C:\winnt\system32\repl\export\scripts directory on your NT PDC. Use the Directory Replicator service to copy the script from your PDC to your BDCs. (You must properly configure the Directory Replicator service before you can use it. See NT's Help file for information about how to configure this service.)
- Use the User Manager for Domains to configure each user account's Logon Script Name to run the batch file you created in Step 1.
where Z: is the drive you want to map to, ServerName is the name of your server, and ShareName is the name of your share.
You can find a wealth of information about creating logon scripts on Microsoft's Web site. For example, go to http://www.microsoft.com/technet and perform a search using the key phrase logon scripts.