Ok everyone, thanks for your help and direction on my first attempt to write scripts. Here is what I have come up with on logging on a user. Thus far......*smile*. It appears to work. If anyone has anymore suggestions or if this helps anyone else. Let me know.Thanks!!! Out of all the bullentin boards I am a member of, this one has been the most productive in such a short amount of time.
Randy
$LoggedOnTo=READPROFILESTRING("\\SERVER\NETLOG\@USERID.TXT","@USERID","LoggedOnTo")
OPEN (1,"@USERID.TXT",0)
IF @ERROR <> 0 GOTO "NewLogIn";If file isnot found this must be a new login.
ENDIF
$X = READLINE(1)
$X = READLINE(1)
$XX = INSTR("$X","@WKSTA");Looking for string on line 2 that = @wksta
IF $XX = 0 GOTO "OFFLOG";Found string. This means user is logged on to another machine.
ENDIF
$LoggedOnTo=READPROFILESTRING("\\SERVER\NETLOG\@USERID.TXT","@USERID","LoggedOnTo")
WRITEPROFILESTRING("\\SERVER\NETLOG\@USERID.TXT","@USERID","LoggedOnTo","@WKSTA")
messagebox("@USERID","Logon is Complete",016)
EXIT
:OFFLOG
IF @INWIN > 1 GOTO "EXIT9X";This will logoff Windows9x.
ENDIF
MESSAGEBOX("$LoggedOnTo","You are currently logged on to....",016)
$RC = LOGOFF(1);This will logoff Windows2000
EXIT
:EXIT9X
MESSAGEBOX("$LoggedOnTo","You are currently logged on to....",016)
RUN @LDRIVE + "\\SERVER\NETLOG\LOGOFF.EXE /N"
QUIT
:NewLogIn
CLOSE(0)
WRITEPROFILESTRING("\\SERVER\NETLOG\@USERID.TXT","@USERID","LoggedOnTo","@WKSTA")
messagebox("@USERID","New Logon is Complete",016)
EXIT