Unfortuneatley, there is no universal method of checking wether a user logged on via RAS or via their LAN connection. Some of the examples in this tip use Kixtart ( see tip 120 ) as the logon script processor.
For a home user, who always logs on via RAS, you can have them place a RASLOG.TXT file in their %Windir% and test for its presence:
if exist %Windir%\raslog.txt goto RAS endif
....
For Windows NT users, you can use the CHECKRAS.EXE utility from the BackOffice Resource kit:
if exist %windir%\checkras.exe goto CRNC endif
copy %logonserver%\netlogon\checkras.exe %windir%
:CRNC
shell "%windir%\checkras"
if @error 1 goto RAS endif
....
For Windows 95 users, check the registry:
$is_ras=readvalue("hkey_local_machine\system\currentcontrolset\services\remoteaccess","remote connection")
if @error=0 goto RAS endif
....
For DOS/WFW/WIN users, use the NETSPEED.COM utility from SMS.