When the logon script runs, a dialog box is presented until the scriptfinishes. Many administrators want a way to minimize this dialog box whileit isrunning, or have it perform in the background so users aren't aware of thelogon script. Because Windows does not use the LMSCRIPT file and you donot want tochange the default properties of Cmd.exe, other methods must be used.
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 theuser accounts in User Manager for Domains. Now, when the users log on toWindows,they will initially run the above batch file, which, in turn, calls thelogonscript and starts it minimized. The last entry in the real logon scriptfile must be EXIT so the file will close properly.
This works great and solves the problem of users seeing the commands beingprocessed in the actual logon script.
Windows for Workgroups clients do not understand the START command,so thiswon't work if you have those clients. Also, the initial call to the logonscript designated in User Manager for Domains still creates a logon dialogbox. The box disappears almost immediately, but may still cause a problemfor the administrator who does not want the user to see anything out ofthe ordinary when logging on. To have the logon script dialog boxminimized duringlogon and support all clients, do the following:
For the initial preparation, insert a pausestatement into the logon script specified in User Manager for Domains. This pause will beimportant because it is needed to access the properties of the logon scriptwindow.
Log on to the workstation as the user in question and, when the logon script pauses, select Properties from the Control menu.
Select the Layout tab in Windows or the Screen Sizeand Position tab, and set the Width and Height on the Screen Buffer Size and Window Size to 1.
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.
Select OK after changing the settings and then you will bepresented with an Apply Properties dialog box. Select "Save properties forfuture windows with the same title" and then select OK.
Log off as the user, remove the pause from the logon script, and thenlog 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 itthrough the screen, use Registry Editor and delete the following key:
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows
After that key is deleted, the default dialog box will once again bepresented for Windows with that same title.
Because logon scripts reside in the NetLogon share of every domaincontroller,the chances are good that you may run the logon script from a differentserver 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 bethe same if you are validated by a different controller. Here are twomethods to solve this problem.
Log on to the workstation as the user inquestion. Select Start and then Run, or File and then Run, and run the batch file using the UNC path for each ofyour domain controllers. For example
When the file runs, follow steps 3 through 5 above and repeat this for eachdomain controller (that is. BDC1, BDC2, BDC3, and so on). This will create an entry in theregistry 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 6above, you will see an entry that looks very similar to the following:
Select the key in question, select Registry and then click Export Registry.Givethe file a name of your choice. Edit the file using Notepad. It will looklike the following:
After you have added an entry for each of your servers, save the file. Youcan now log on as any user with the same windows resolution and simplydouble-click this file or import it into the registry using REGEDIT.All users will now have the same window settings on the logon script forany authenticating server.