Here Maarten, give this code a try... You were also missing an ENDIF statement.

Code:
;--------------------------------------------
CLS
; I'd use Break On at least during testing otherwise if you break it will log you off
Break On
Debug ON
Dim $iRC
$iRC=SetOption('Explicit','On')
$iRC=SetOption('NoVarsInStrings','On')
Dim $ConnectI,$ConnectJ,$ConnectK,$ConnectL,$ConnectM,
Dim $Greeting,$userdir,$emaildir
Dim $DriveI,$DriveJ,$DriveK,$DriveL,$DriveM
Dim $Hour,$Msg


;Time equal with server
;--------------------------------------------
SetTime @lserver
? 'Setting Time was: ' + @ERROR + ' ' + @SERROR

;Global Variables
;--------------------------------------------

;Don't need to double up in this case if you use NoVarInStrings option
;$hidden="$$"
$ConnectI="NoConnection"
$ConnectJ="NoConnection"
$ConnectK="NoConnection"
$ConnectL="NoConnection"
$ConnectM="NoConnection"
$Greeting="none"

;printer
;--------------------------------------------
;AddPrinterConnection("\\wsrv01\MaanDesk")
;SetDefaultPrinter("\\wsrv01\MaanDesk")

;HomeDirectory
;--------------------------------------------
use I: /Del
? 'Deleting I: was: ' + @ERROR + ' ' + @SERROR
$userdir='\\wsrv01\'+@USERID+'$'
Use I: $userdir
? 'Mapping I: was: ' + @ERROR + ' ' + @SERROR

If @error <> 0
Beep
$ConnectI="False"
Sleep 2
Else
$ConnectI="True"
EndIf

;email
;--------------------------------------------
; Odd logic here, you unmap the J: drive but only remap if in a group
use J: /Del
? 'Deleting J: was: ' + @ERROR + ' ' + @SERROR
If InGroup("email")
$emaildir='\\wsrv01\mail_' + @USERID + '$'
Use J: $emaildir
? 'Mapping J: was: ' + @ERROR + ' ' + @SERROR
EndIf

If @error <> 0
Beep
$ConnectJ="False"
Sleep 2
Else
$ConnectJ="True"
EndIf

;K - share
;--------------------------------------------
use K: /Del
? 'Deleting K: was: ' + @ERROR + ' ' + @SERROR
Use K: "\\wsrv01\Algemeen"
? 'Mapping K: was: ' + @ERROR + ' ' + @SERROR

If @error <> 0
Beep
$ConnectK="False"
Sleep 2
Else
$ConnectK="True"
EndIf

;L - Share
;--------------------------------------------
use L: /Del
? 'Deleting L: was: ' + @ERROR + ' ' + @SERROR
Use L: "\\lsrv01\apps"
? 'Mapping L: was: ' + @ERROR + ' ' + @SERROR

If @error <> 0
Beep
$ConnectL="False"
Sleep 2
Else
$ConnectL="True"
EndIf
;M - Share
;---------------------------------------------
use M: /Del
? 'Deleting M: was: ' + @ERROR + ' ' + @SERROR
Use M: "\\lsrv01\mp3"
? 'Mapping M: was: ' + @ERROR + ' ' + @SERROR

If @error <> 0
Beep
$ConnectM="False"
Sleep 2
Else
$ConnectM="True"
EndIf

;web
;--------------------------------------------
If InGroup("Web")
Use N: "\\lsrv01\www"
? 'Mapping N: was: ' + @ERROR + ' ' + @SERROR
Use O: "\\lsrv01\sql"
? 'Mapping O: was: ' + @ERROR + ' ' + @SERROR
EndIf

;Variabelen
;--------------------------------------------
;Could also do something like this
;$DriveI=IIf($ConnectI,'- I: Persoonlijke Netwerkschijf',"")

If $ConnectI="True"
$DriveI="- I: Persoonlijke Netwerkschijf"
Else
$DriveI=""
Endif

If $ConnectJ="True"
$DriveJ="- J: Emaildata Netwerkschijf"
Else
$DriveJ=""
Endif

If $ConnectK="True"
$DriveK="- K: Algemene Netwerkschijf"
Else
$DriveK=""
; Was missing an EndIf
EndIf

If $ConnectL="True"
$DriveL="- L: Programma's netwerkschijf"
Else
$DriveL=""
Endif
If $ConnectM="True"
$DriveM="- M: Muziek netwerkschijf"
Else
$DriveM=""
Endif

;Moment van de dag
;--------------------------------------------
$hour = Val(SubStr(@TIME,1,2))
Select
Case $Hour < 6
$Greeting = "Goedenacht"
Case $Hour < 12
$Greeting = "Goedemorgen"
Case $Hour < 18
$Greeting = "Goedemiddag"
Case 1
$Greeting = "Goedenavond"
EndSelect

;welkoms scherm
;--------------------------------------------
;welkoms scherm
;--------------------------------------------
$Msg = ''+$Greeting + @FullName
+'Welkom Op het netwerk van: MAAN'
+'De volgende netwerkschijven zijn verbonden:'
+ @CRLF + $DriveI
+ @CRLF + $DriveJ
+ @CRLF + $DriveK
+ @CRLF + $DriveL
+ @CRLF + $DriveM
; Removed the time out from the MessageBox for testing
$Msg = MessageBox($Msg,'Login Script',64)