If Not @LogonMode
Break On
Else
Break Off
EndIf
CLS
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')
$SO=SetOption('WrapAtEOL','On')
$SO=SetTitle('Church Login Script')
$SO=SetConsole('maximize')
Dim $x
;Should add either the name of the Domain or the macro for current Domain
If InGroup(@Domain+'\church_admin')
use L: /delete /persistent
use M: /delete /persistent
;Really don't see the need for setting it persistent if you're
;going to map it every logon and delete it every logon
;(yes parameter not needed)
use L: \\bcbkup01\avfoldera /persistent
use M: \\bcbkup01\avfolderb /persistent
EndIf
If InGroup(@Domain+\'churchusers')
use J: /delete
use J: "\\bcbkup01\images" /persistent
EndIf
;No need to clear screen again as you have not shown anything yet
cls
Color r+/n
small
Color R+/n
BOX (0,0,24,79,GRID) ; 'background grid'
Color b/n
BOX (8,21,18,61,Å) ; 'shadow' of the box
Color g+/n
BOX (7,20,17,60,FULL)
Color w+/n
AT ( 9,25) "Userid : " ; display some text strings
AT (10,25) "Full name : "
AT (11,25) "Privilege : "
AT (12,25) "Workstation : "
AT (13,25) "Domain : "
AT (14,25) "Logon Server : "
Color y+/n
AT ( 9,40) @userid ; ...and some macro's
AT (10,40) @fullname
AT (11,40) @priv
AT (12,40) @wksta
AT (13,40) @domain
AT (14,40) @lserver
Color w/n
sleep 2
cls
;Should be in quotes and should be in the NETLOGON share
Display 'message.txt'
sleep 2
cls
;Do not see why this is here, you do not seem to use it for anything
$x = SubStr(@ipaddress0,7,1)
If Open(3 ,'\\bcbkup01\log\log.txt' ,5) = 0
$x = WriteLine(3,"User: " + @fullname + " " + @userid + " " + @wksta +" Logged on " + @date + " " + @time + " " + @ipaddress0 +@CRLF)
Else
? "Failed to open file, error code : [" + @error + "]"
EndIf
;Need to sleep or something otherwise if you want to show this error
;otherwise the user will not have time to see it
Sleep 3
cls
;What is in this timeset.cmd file? On an Active Directory you should
;not be setting the time as it is automated now days
;Regardless you should also run it with comspec
; Shell '%comspec% /c \\churchdomain\netlogon\timeset.cmd '
shell "\\churchdomain\netlogon\timeset.cmd"
;You should either provide an @ERROR exit or a given exit code
exit