Rem: Creating Logon Scripts

By creating logon scripts, you can map network drives and perform other client configuration tasks during logon.

Bob Wells

April 22, 2001

1 Min Read
ITPro Today logo in a gray background | ITPro Today

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:

  1. 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

    net use Z: \ServerNameShareName

    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.

  2. Save the batch file to the C:winntsystem32replexportscripts 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.)

  3. 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.

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.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like