Determining whether a client is logging in through the network or remote access helps you specify which parts of the script to run. CheckRAS is a command-line, SMS resource kit utility to determine whether a user is using remote access. To determine whether the current user is using remote access during a logon script, proceed as follows:
- Create a new directory to store all files included in this example.
- Select Start|Run and enter “scriptfile.bat.”
Here, scriptfile is the full path and file name of a script file that contains the following:
@Echo Off
CLS ; Clears the screen
Set RAS=NO
fullpath\CheckRAS > Nul
If %errorlevel% EQU 1 Set RAS=YES
Here, fullpath is the full path where the CheckRAS utility is located, and RAS indicates whether the current user is using remote access or not.
