If you want to do the check by IP address range method, it can be done in the batch file so no copying of Kix files is needed.

Works great even for VPN users which the @RAS method may not catch if the person is using DSL, cable modem or connecting from a remote office.

Only really good for searching for whole class C addresses though in it's current form. Could probably be modified to search for sections of a class if you wanted to.

- Login.bat --

code:
echo Checking for Dial-up connection.....
REM - Dial up range 1
route print | find "0.0.0.0" | find "AAA.BBB.CCC"
REM - AAA.BBB.CCC represents an IP address range to search for.
if errorlevel 1 goto next1
goto dupusr
:next1
REM - Dial up IP range 2
route print | find "0.0.0.0" | find "AAA.BBB.CCC"
if errorlevel 1 goto next2
goto dupusr
:next2
REM - VPN IP range
route print | find "0.0.0.0" | find "AAA.BBB.CCC"
if errorlevel 1 goto goclient
goto dupusr
REM - Dial up range not detected, LAN User.
REM - Start KixStart
Goto end
:dupusr
REM - Dial up user detected
REM - Don't start KixStart
:end

-- End Login.bat --

---------------------------------------------
I am now using this Login.bat which requires even remote computers to copy a very small 54k grep program. Should make adding custom IP ranges easier because of the more powerful grep utility.

--- Login.bat ---

code:
@echo off
xcopy /q /d /c %0\..\grep.exe %windir% > nul
echo Checking for Dial-up connection.....
route print | %windir%\grep -e "0.0.0.0" | %windir%\grep -c -e "AAA.BBB.CCC" -e "AAA.BBB.DDD" -e "AAA.BBB.EEE" > nul
if errorlevel 1 goto goclient

:dupusr
goto end

:goclient
xcopy /q /d /c %0\..\kix32.exe %windir% >nul
If "%os%"=="Windows_NT" goto NT
xcopy /q /d /c %0\..\kx32.dll %windir% >nul
xcopy /q /d /c %0\..\kx16.dll %windir% >nul
xcopy /q /d /c %0\..\kx95.dll %windir% >nul

:NT
%windir%\kix32.exe %0\..\login.kix
goto end

:end



--- Login.bat ---


Mark P.

[This message has been edited by mpearce (edited 05 December 2000).]