How to Hide the Logon Script Dialog Box on a Windows NT Client

ID: Q176197


The information in this article applies to:
  • Microsoft Windows NT Workstation versions 3.5, 3.51, 4.0
  • Microsoft Windows NT Server versions 3.5, 3.51, 4.0
  • Microsoft Windows 2000 Professional
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server


IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.

SYMPTOMS

When the logon script runs, a dialog box is presented until the script finishes. Many administrators want a way to minimize this dialog box while it is running, or have it perform in the background so users aren't aware of the logon script. Because Windows NT does not use the LMSCRIPT file and you do not want to change the default properties of Cmd.exe, other methods must be used.


RESOLUTION

Create a batch file that calls the actual logon script. Using Notepad, create a file that has the following entry:


   START /MIN LOGON.BAT 

Save the batch file and specify this file as the logon script name for the user accounts in User Manager for Domains. Now, when the users log on to Windows NT, they will initially run the above batch file, which, in turn, calls the logon script and starts it minimized. The last entry in the real logon script file must be EXIT so the file will close properly.

This works great and solves the problem of users seeing the commands being processed in the actual logon script.

Windows for Workgroups clients do not understand the START command, so this won't work if you have those clients. Also, the initial call to the logon script designated in User Manager for Domains still creates a logon dialog box. The box disappears almost immediately, but may still cause a problem for the administrator who does not want the user to see anything out of the ordinary when logging on. To have the logon script dialog box minimized during logon and support all clients, do the following:

  1. For the initial preparation, insert a pause statement into the logon script specified in User Manager for Domains. This pause will be important because it is needed to access the properties of the logon script window.


  2. Log on to the workstation as the user in question and, when the logon script pauses, select Properties from the Control menu.


  3. Select the Layout tab in Windows NT 4.0 or the Screen Size and Position tab for Windows NT 3.51, and set the Width and Height on the Screen Buffer Size and Window Size to 1.


  4. Set the Window Position to 0 for the Left setting and set the Top position to the highest number possible (this will vary depending on the screen resolution). This will put the Window in the lower left-hand corner of the screen.


  5. Select OK after changing the settings and then you will be presented with an Apply Properties dialog box. Select "Save properties for future windows with the same title" and then select OK.


  6. Log off as the user, remove the pause from the logon script, and then log back on. The dialog box is still present, but in the lower left corner of the screen out of the users way.


If, at a later time, you need to resize the windows and cannot access it through the screen, use Registry Editor and delete the following key:

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys and Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it. If you are running Windows NT, you should also update your Emergency Repair Disk (ERD).

HKEY_CURRENT_USER\Console\_ComputerName_NETLOGON_LogonScript

After that key is deleted, the default dialog box will once again be presented for Windows with that same title.


MORE INFORMATION

Because logon scripts reside in the NetLogon share of every domain controller, the chances are good that you may run the logon script from a different server than the one used in the above example.

Your file is represented in the registry as _ComputerName_NETLOGON_LogonScript. The computer name obviously won't be the same if you are validated by a different controller. Here are two methods to solve this problem.

  • Log on to the workstation as the user in question. Select Start and then Run, or File and then Run, and run the batch file using the UNC path for each of your domain controllers. For example

    
    run \\PDC\NETLOGON\logon.bat 

    When the file runs, follow steps 3 through 5 above and repeat this for each domain controller (that is. BDC1, BDC2, BDC3, and so on). This will create an entry in the registry for the logon script on each of the possible authenticating servers.


  • You can, when you are logged on as the user in question, run REGEDIT.

    Expand the HKEY_CURRENT_USER\Console folder. After going through steps 1 through 6 above, you will see an entry that looks very similar to the following:

    _ComputerName_Share_logon.scr

    Select the key in question, select Registry and then click Export Registry. Give the file a name of your choice. Edit the file using Notepad. It will look like the following:

    REGEDIT4

    [HKEY_CURRENT_USER\Console\__SERVER_NETLOGON_logon.bat]
    "HistoryNoDup"=dword:00000000
    "WindowSize"=dword:0001000d
    "WindowPosition"=dword:01c00000
    "ScreenBufferSize"=dword:0001000d
    "FontSize"=dword:000c0008
    "FontFamily"=dword:00000030
    "FontWeight"=dword:00000190

    Copy the above information and paste it below, changing the SERVER name to the name of another authenticating server. Do this for all your domain controllers. The file will now look like the following:

    REGEDIT4

    [HKEY_CURRENT_USER\Console\__SERVER_NETLOGON_logon.bat]
    "HistoryNoDup"=dword:00000000
    "WindowSize"=dword:0001000d
    "WindowPosition"=dword:01c00000
    "ScreenBufferSize"=dword:0001000d
    "FontSize"=dword:000c0008
    "FontFamily"=dword:00000030
    "FontWeight"=dword:00000190

    [HKEY_CURRENT_USER\Console\__SERVER2_NETLOGON_logon.bat]
    "HistoryNoDup"=dword:00000000
    "WindowSize"=dword:0001000d
    "WindowPosition"=dword:01c00000
    "ScreenBufferSize"=dword:0001000d
    "FontSize"=dword:000c0008
    "FontFamily"=dword:00000030
    "FontWeight"=dword:00000190

    [HKEY_CURRENT_USER\Console\__SERVER3_NETLOGON_logon.bat]
    "HistoryNoDup"=dword:00000000
    "WindowSize"=dword:0001000d
    "WindowPosition"=dword:01c00000
    "ScreenBufferSize"=dword:0001000d
    "FontSize"=dword:000c0008
    "FontFamily"=dword:00000030
    "FontWeight"=dword:00000190

    After you have added an entry for each of your servers, save the file. You can now log on as any user with the same windows resolution and simply "double-click" on this file or import it into the registry using REGEDIT. All users will now have the same window settings on the logon script for any authenticating server.


Additional query words:

Keywords : NTSrvWkst
Version : WINDOWS:2000; winnt:3.5,3.51,4.0
Platform : WINDOWS winnt
Issue type :


Last Reviewed: January 18, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.