@echo off
REM Check for Windows Terminal Server session
if /i "%SESSIONNAME%" == "Console" goto :cont
if not "%SESSIONNAME%" == "" goto :metaframe
if not "%WINSTATIONNAME%" == "" goto :metaframe
:cont
"%0\..\SVRINFO.EXE" > NUL
if errorlevel 4 goto :exit
title Welcome to The Corporate Logon Script
echo Updating KiXtart...
if not exist c:\kixtart\. md c:\kixtart
xcopy "%0\..\kix32.exe" "c:\kixtart" /d /v /c /q /h /r > nul 2> nul
echo Running login script...
c:\kixtart\kix32.exe %1 %0\..\kixtart.kix
goto :exit
:metaframe
echo Updating KiXtart...
if not exist c:\kixtart\. md c:\kixtart
xcopy "%0\..\kix32.exe" "c:\kixtart" /d /v /c /q /h /r > nul 2> nul
echo login script is executing
xcopy "%0\..\..\TermServ.kix" "c:\kixtart\*.*" /d /v /c /q /h /r > nul 2> nul
xcopy "%0\..\mapdrives.kix" "c:\kixtart\*.*" /d /v /c /q /h /r > nul 2> nul
c:\kixtart\kix32.exe c:\kixtart\TermServ.kix
:exit