A VBScript program with the extension .vbs can be specified as the logon script for clients with Windows NT or above. However, only batch files can run as logon scripts on Windows 95, Windows 98, and Windows ME clients.

This batch file program is intended to serve as the logon script for all clients. This is useful in environments where users could logon to clients that do not support VBScript programs as logon scripts directly, but you want to take advantage of the power of VBScript where you can. The program first determines if the client is a 32-bit Windows operating system. If it is, it launches a VBScript logon script program. If the client is not 32-bit, a fallback DOS based logon script is launched.

Windows 95 and Windows 98 clients require a loop to retrieve the UserName from the WshNetwork object. In order for this loop to work, the VBScript program must be launched with the wscript host. If the VBScript logon script is launched with the cscript host, the loop will never retrieve the value of the UserName property from the WshNetwork object. Cscript suspends the background user authentication process while the script runs. Wscript allows user authentication to the client to continue. This batch file launches the VBScript logon script with the wscript host.

NetLogon.txt <<-- Click here to view or download the program

In rare cases, Windows 95, Windows 98, or Windows ME clients might report an error and fail to launch the VBScript program from the batch file specified as the logon script. If this happens, click on the link at left for a discussion and possible remedies.