KIX Logon Skript

Dieses KIX Skript kann z.B. aus einer Logon.bat mit
Start /max cmd /c "color f0 & %0\..\kix32.exe logon.kix
aufgerufen werden.

Global $TS, $FS1, $FS2, $PS, $USERLOG, $CRLF, $ADready
$TS = "Server01"
$FS1 = "Server02"
$FS2 = "Server03"
$PS = "Server04"
$CRLF = Chr(13) + Chr(10)

$ADready = False

$USERLOG = "\\" + $FS1 + "\USERLOG$"

;BREAK ON ;*** for testing purpose only - Default is BREAK OFF
;********************************
;* main
;********************************
GOSUB "GREETING"
GOSUB "NEWS"
GOSUB "LOG_LOGON"
GOSUB "GET_OS"
GOSUB "MAP_DRIVES"
GOTO "END"
;********************************
;* end main
;********************************


;********************************
;*** Begrüßung
;********************************
:GREETING
small
Color g+/c+
BOX (3,5,19,73,FULL)
color b/c+
IF @TIME > 00:01:00 AND @TIME < 11:00:00
    AT ( 5,8) "Good morning @FULLNAME,"
ENDIF
IF @TIME > 11:00:00 AND @TIME < 14:00:00
    AT ( 5,8) "Good day @FULLNAME,"
ENDIF
IF @TIME > 14:00:00 AND @TIME < 17:00:00
AT ( 5,8) "Good afternoon @FULLNAME,"
ENDIF
IF @TIME > 17:00:00 AND @TIME < 00:01:00
AT ( 5,8) "Good evening @FULLNAME,"
ENDIF
color n/c+
AT ( 7,8) "You will be logged on to the PC Network (LAN) of the"
AT ( 8,8) "World Wide Engineering Company."
AT ( 10,8) "Current time: @TIME"
AT ( 11,8) "Your Logon Name: @USERID"
AT ( 12,8) "Your Logon Server: @LSERVER"
AT ( 14,8) "Enjoy your work."
AT (17,8) "If you have Problems, please call PC Support - Tel: 1234"
color n/w+
AT (21,8) " "
?
RETURN

;********************************
;* News of the day aus UserLog$\News\News.txt ausgeben
;********************************
:NEWS
If Exist ($USERLOG + "\News\News.txt")
    ? ?
    color r+/w+
    Display $USERLOG + "\News\News.txt"
    ?
    ?
    color n/w+
    ? "Press any key ..."
    Get $x
    ?
    ?
ENDIF
RETURN


;********************************
;*** Anmeldung protokollieren
;********************************
:LOG_LOGON
if OPEN(1,$USERLOG + "\logon.txt",5) = 0
    Writeline(1, @UserID + ";" + @FullName + ";" + @Wksta + ";" + @DATE + ";" + @TIME + ";" + @LSERVER + $CRLF)
    CLOSE(1)
ENDIF
RETURN


;********************************
;*** Betriebssystem abfragen, Flag und ggfls. Time setzen
;********************************
:GET_OS
SELECT
CASE INSTR (@ProductType, "Windows 2000") > 0
$ADready = True
CASE INSTR (@ProductType, "Windows XP") > 0
$ADready = True
CASE INSTR (@ProductType, "Windows Server 2003") > 0
$ADready = True
ENDSELECT
IF $ADready = False
    SETTIME "@lserver"
ENDIF
RETURN


;********************************
;*** Laufwerke verbinden
;********************************
:MAP_DRIVES
IF not INGROUP("Domain Admins")
    CALL "map_drives.kix"
ENDIF
RETURN


;********************************
;* Finito
;********************************
:END
Sleep 2
exit


KIX Basics