I have changed the "$Exit.OnClick" to "ExitApp.OnClick"

Code:
 $ExitApp.OnClick = "$$ExitApp.OnClick=1" 




Code:
Function runscripts ()

Del "c:\mtglaptop\logs\*.log"
If Exist($inifile)
$ScriptArray = Split(ReadProfileString($inifile,"",""),Chr(10))
For Each $script in $ScriptArray
If Val(ReadProfileString($inifile,$script,"run"))
$leave=0
$starttime=@TIME
$message=ReadProfileString($inifile,$script,"message")
$log=ReadProfileString($inifile,$script,"log")
If $testrun=3
MessageBox ("Requestable job available. Do you want to run $message?","Requestable job",36,0)
EndIf
$item=$listview.items.add
$Item.SubItems(0).Text = ($message)
$Item.SubItems(1).Text = ($starttime);(@FULLNAME +"\"+ @USERID)
$Item.SubItems(3).Text = ($log)
$Item.SubItems(4).Text = ("Running")
Select
Case InStr ($script,".exe")
Shell $script
Case InStr ($script,".kix")
Call $script
EndSelect
Do
If $$ExitApp.OnClick =1
Quit()
EndIf
Until
Exist ("c:\mtglaptop\logs\"+$log)
$Item.SubItems(2).Text=(@time)
$Item.SubItems(4).Text=("Complete")

EndIf
Next


EndFunction

_________________________
I haven't failed. I just found another way that did not work.