Problem solve Get help with specific problems with your technologies, process and projects.

Stop logon scripts from treating servers as clients

There's a simple way to stop your logon script from making unwanted changes on your servers that were designed for clients.

This tip was submitted to the SearchWin2000 Tip Exchange by member Michael Corkery. Let other users know how useful it is by rating the tip below.

There's a simple way to stop your logon script from making unwanted changes on your NT/2000/XP servers that were designed for your clients (mapping drives and printers, making registry changes, setting policies, etc).

1. Right-click the .bat file stored in the "C:WINNTsystem32ReplExportScripts" folder on your PDC (usually called "logon.bat," but can be any name,) and select "Edit." The file opens in Notepad.

You should include the following three lines as close to the start of the file as possible - ideally just below the first "@echo off" -- before any commands are run or any of the .kix files are called:


  • REM (This breaks servers out of the logon script.)
  • @echo off
  • if exist systemrootlanma256.bmp goto SERVEREND

    Then append to the very end of the file (after the normal exit command for clients) the following:


  • :serverend
  • REM (This exits the LOGON batch file if a server logs in.)
  • @echo This is a Server, aborting logon
  • exit

    How this works is simple -- on Windows NT or higher, all servers have the server graphic "lanma256.bmp" in the systemroot folder (which means that even if it's not installed on the C: partition, it will still work). The clients have the file "winnt256.bmp." Pre-NT Windows clients are OK too, as they do not have the server graphic that is the condition for breaking the script.

    As always, backup the original "logon.bat" file before making any changes, and test the new script before putting it back on the PDC to replicate. Hope this helps!

Dig Deeper on Windows Server storage management

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.