I've created this LOGON.BAT to be as flexible as possible. Thus, it's a little bit big (3KB) but it seems to work well in my network. I haven't been able to test it under Windows XP, though.
This script will take care of those instances where a normal user logs into a Windows 2000/XP computer where KiXtart has not been installed locally. Normally, copying into the %WINDIR% folder requires administrative privileges, so the login script will not be able to do so for a regular user. Additionally, if for whatever reason the KiXtart executable cannot be found in either %WINDIR% or the NETLOGON folder, an error message is displayed and an alert is sent to the Systems Administrator.
Comment and bug reports welcome and encouraged!!
code:
@ECHO OFF
CLS
ECHO Verifying / Updating Script Software Installation
SETLOCAL
REM detect the operating system and go to the appropriate segment
VER | find "NT" > nul
IF not errorlevel 1 GOTO Win_NT
VER | find "2000" > nul
IF not errorlevel 1 GOTO Win_2K
VER | find "XP" > nul
IF not errorlevel 1 GOTO Win_XP
VER | find "98" > nul
IF not errorlevel 1 GOTO Win_98
VER | find "95" > nul
IF not errorlevel 1 GOTO Win_95
VER | find "Millennium" > nul
IF not errorlevel 1 GOTO WIN_ME
GOTO DOS
REM client is running DOS
:DOS
ECHO.
ECHO No Login Script Available For DOS Clients
ECHO.
GOTO End
REM client is running Windows 9x
:Win_95
:Win_98
:Win_ME
%WINDIR%\COMMAND\XCOPY %0\..\KIX32.EXE %WINDIR%\ /D /H /I /R /V /C > NUL
%WINDIR%\COMMAND\XCOPY %0\..\KX*.DLL %WINDIR%\ /D /H /I /R /V /C > NUL
GOTO RunScript
REM client is running Windows NT/2000
:Win_NT
:Win_2K
:Win_XP
ECHO y| XCOPY %0\..\KIX32.EXE %WINDIR%\ /D /H /I /R /V /C > nul
GOTO RunScript
REM client is running Windows XP
REM the DEL command removes any Kixtart file from the %WINDIR%\SYSTEM32 directory
ECHO y| XCOPY %0\..\KIX32.EXE %WINDIR%\ /D /H /I /R /V /C > nul
GOTO RunScriptXP
REM run the logon script for Windows 9x/ME/NT/2K
:RunScript
ECHO.
ECHO Loading Logon Script, Please Wait...
ECHO.
REM check whether Kixtart is installed locally
IF EXIST %WINDIR%\KIX32.EXE GOTO LocalExe
IF EXIST %0\..\KIX32.EXE GOTO RemoteExe
GOTO KixtartError
REM Kixtart is not installed locally
:RemoteExe
%0\..\KIX32.EXE %0\..\LOGIN.KIX
GOTO End
REM Kixtart is installed locally
:LocalExe
%WINDIR%\KIX32.EXE %1 %0\..\LOGIN.KIX
GOTO End
REM run the logon script for Windows 9x/ME/NT/2K
:RunScriptXP
ECHO.
ECHO Loading Logon Script, Please Wait...
ECHO.
REM check whether Kixtart is installed locally
IF EXIST %WINDIR%\KIX32.EXE GOTO LocalExeXP
IF EXIST %0\..\KIX32.EXE GOTO RemoteExeXP
GOTO KixtartError
REM Kixtart is not installed locally
:RemoteExeXP
KIX32.EXE LOGIN.KIX
GOTO End
REM Kixtart is installed locally
:LocalExeXP
%WINDIR%\KIX32.EXE LOGIN.KIX
GOTO End
:End
ECHO.
ECHO.
ECHO Finishing Login...
@ECHO OFF
CLS
EXIT 0
:KixtartError
REM Display an error message and notify the systems Administrator since the user won't be doing it anyway
ECHO.
ECHO Error loading the NMRC-NT logon script
ECHO.
ECHO Please notify the Systems Administrator!
ECHO.
NET SEND REDPOINT "Error loading the NMRC-NT logon script for user "%USERNAME%" on computer "%COMPUTERNAME% >nul
PAUSE
GOTO End
[ 20. January 2003, 21:55: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.