Q. How can I prevent a user logon script from running on a specific Windows Server 2003 computer?

Jerold Schulman

September 13, 2006

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

If you want to prevent a user logon script from running on a specific Windows Server 2003 computer, like a Terminal Server, you can prevent the Userinit.exe process from running it, by altering the Userinit Value Name at HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon and by setting the UserInitLoginScript variable to nul:

1. Save the following to a FolderNameDisableLogonScript.cmd file:

@echo offSet UserInitLogonScript=Start %systemroot%system32userinit.exeexit

2. Open a CMD.EXE window.

3. Type the following command and press Enter:

REG ADD "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogon" /V Userinit /T REG_SZ /F /D "FolderNameDisableLogonScript.cmd"

NOTE: FolderName is the drive letter and folder path where you saved the DisableLogonScript.cmd file.


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