JSI Tip 0120 - Solve those logon script problems.
April 13, 1997
Kixtart is a logon script processor for Windows NT /2000 and Windows 9x. It was designed and developed by Rudd Van Velsen of Microsoft Benelux. In conjunction with Winset.exe (from the Windows 95 CD), you can set environment variables into Windows 95 that will allow you to have common environment variables for your Windows NT and Windows 95 clients. In the partial logon script sequence below, I have made the following assumptions:
1. In User Manager for Domains, the logon script in each user's profile is LOGON
2. LOGON.BAT is located in your server's NETLOGON share and contains:
@echo off
%0..KIX32 LOGON
Exit
3. LOGON.SCR is the KixTart 95 script, and along with Winset.exe, is also located in the NETLOGON share
4. The Winset.exe file have been installed in the SYSTEM sub-directory on your Windows 95 clients.
Do not use any of the environment variables that you set into Win95 in the Kixtart 95 script, they are for use after logon, unless you also issue a SETL and shell any batch programs that may use them during logon.
Here is LOGON.SCR
CLS
AT (1,1)
If @INWIN = 2 ; If Client WS is Windows 95
$L = "@LSERVER" + "" + "NETLOGON" + "" + "WINSET.EXE"
shell "$L USERNAME=@USERID"
shell "$L HOMEDRIVE=X:" ; Same drive you configured in User Manager
shell "$L HOMEPATH=@HOMEDIR"
shell "$L HOMESHARE=@HOMESHR"
shell "$L COMPUTERNAME=@WKSTA"
shell "$L USERDOMAIN=@DOMAIN"
shell "$L LOGONSERVER=@LSERVER"
shell "$L USERPROFILE=@HOMESHR"
shell "$L OS=Windows_95"
setl "USERNAME=@USERID"
setl "HOMEDRIVE=X:"
setl "HOMEPATH=@HOMEDIR"
setl "HOMESHARE=@HOMESHR"
setl "COMPUTERNAME=@WKSTA"
setl "USERDOMAIN=@DOMAIN"
setl "LOGONSERVER=@LSERVER"
setl "USERPROFILE=@HOMESHR"
setl "OS=Windows_95"
endif
If @WKSTA "@LSERVER" ; If Client WS is not this Server
settime "@LSERVER" ; Set time on client to Server
endif
use X: "@HOMESHR" ;Kix32 version of NET USE
$S = "@LSERVER" + "" + "NETLOGON" + "" + "sales.txt"
IF INGROUP("Sales") and EXIST("$S")
Display "$S"
AT (23,1) "Press any key to continue"
GET $A
endif
$B = "@LSERVER" + "" + "NETLOGON" + "" + "LOGBAT.BAT"
shell "$B" ;Shell to a batch file if you wish
CLS
BIG
$X = 1
DO
COLOR w/n
AT ( $X,$X*2 ) "@USERID"
$X = $X+1
UNTIL $X = 6
COLOR g+/n
AT ( $X,$X*2 ) "@USERID"
sleep 3
AT (23,0)
SMALL
cookie1 ; required to tell Win95 that the script is finished when performing LMSCRIPT emulation
exit
Kixtart 95 supports many commands, functions, and macros including registry and file manipulation, messaging, printer (dis)connection, group membership testing, and more. I highly recommend it.
to index
About the Author
You May Also Like