User logon scripts contain a set of instructions. These instructions are run when a computer starts. For example, a user logon script may contain instructions about how to map network drives, about how to connect to network printers, or about how to run an antivirus program.
You may experience certain situations where you may want to prevent a computer from running a user logon script. For example, you may want to do this when a terminal server hosts a special environment for a forest.
The user logon script is started from the Userinit.exe process. The Userinit registry value describes the programs that are started by the Winlogon.exe process. The Winlogon.exe process retrieves the Userinit startup parameters from a registry entry inside the following Winlogon registry subkey:
To prevent the system from running the user logon script, the UserInitLoginScript variable must be removed. To do this, follow these steps:
- Click Start, point to Programs, point to Accessories, and then click Notepad.
- Copy and paste the following code into Notepad:
- Save the text file as a program file by using the .cmd file name extension. For example, save it as DisableLogonScript.cmd.
- Click Start, click Run, type regedit, and then click OK.
- Locate and then click the following registry subkey:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
- In the right pane, double-click Userinit.
- In the Value data box, delete the userinit.exe entry, and then type the full path of the file that you created in step 3.
- Click OK.
- Exit Registry Editor.
Article ID: 924034 - Last Review: Jan 4, 2008 - Revision: 1