Missing quotes: OS=SetOption('NoVarsInStrings',On)
try this (what is the result?):
Code:
Dim $0S, $Msg, $Answer, $RC
$OS=SetOption('Explicit','off')
$OS=SetOption('NoVarsInStrings','On')
$OS=SetOption('WrapAtEOL','On')
$Answer = MessageBox ("please confirm that you have read and understood the firm's IT policy. If you have any questions relative to this please contact Gary or Rae", "Reminder", 4180)
If $Answer <> 6
$Msg=MessageBox ( "You are unable to log to the network", "call your IT Administrator", 4112)
$RC=Logoff(1)
Else
;$ = shutdown("","you are being logged off",45,1,1)
$Msg=MessageBox ("You are now beeing connected to the network","Welcome to Johnsons MME",64,5)
Endif
If InGroup("JMME-General")
MapDrive("F:", "jmmes", "Vol1")
MapDrive("G:", "jmmes", "mCalas")
MapDrive("H:", "jmmes", "caldata")
MapDrive("I:", "jmmes", "s6system")
MapDrive("J:", "jmmes", "winapp")
; K: Drive Mapped by OS as Home Share
MapDrive("L:", "jmmes", "abas")
MapDrive("M:", "jmmes", "vol1")
MapDrive("N:", "jmmes", "netapps")
MapDrive("O:", "jmmes", "JMME-FPlan")
MapDrive("P:", "jmmes", "apps")
MapDrive("Q:", "jmmes" ,"NotesMME")
MapDrive("S:", "jmmes", "vol2")
MapDrive("T:", "jmmes", "templates")
MapDrive("Y:", "jmmes", "PWCDll")
MapDrive("Z:", "jmmes", "Mcalasutils")
Endif
Function MapDrive($Drive, $Server, $Share)
Dim $Drive, $Server, $Share, $shell
Color c+/n
If $Drive<>"" and $Server<>"" and $Share<>""
$LogText="Connecting $Drive to \\$Server\$Share"
? $LogText
USE $Drive /Delete /Persistent
USE $Drive "\\" + $Server + "\" + $Share
If @error=0
color g+/n
$x = " - Success"
$x
If val($DOS) >= 5
$shell=createobject("shell.application")
$shell.namespace($Drive+"\").self.name=$Share + " on '" + $Server + "'"
$shell = 0
Endif
Else
color r+/n
$x = " - Failed: Error " + @error
$x
$ErrorState=1
Endif
; Commented out logging
;WriteLog ($LogText + $x)
;WriteLog2("%temp%\MapDrive.log",$LogText + $x,1)
Color w+/n
Else
? "Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'"
; Commented out logging
;WriteLog ("Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'")
Endif
Endfunction