Hi,

Than you jfor all your help as you can see it took me a long time to understand what is going on this is appart of the other 100s things I need to do .
So I looked at all your suggetions at try to put it all together. I would appricate if you are abale to help me ant let me know of it will work or if it makes any sens.
Just to reminde you :
windows server envir'
XP SP1 and WIn2000 SP3 envir'
I need to make usre the messagebox comes up every 45 days.
Ok this is the Script:

Code:

Dim $OS, $Msg, $Answer, $RC

$OS=setOption('Explicit','off')
$OS=setOption('NoVarsInString','On')
$OS=setOption('WrapAtEOL','On')

Dim $SetCounter, $Key, $KeyValue, $Delay, $KiXtartSchedule

$Delay=3888000
$SetCounter=FileTime(@Date,@Time)
$KiXtartSchedule="HKEY_CURRENT_USER\Software\LogOnScripts\Schedule\45"
$Key=KeyExist($KiXtartSchedule)
If $Key
$KeyValue=Val(ReadValue($KiXtartScheduale,'time'))
If SetCounter > ($KeyValue+$Delay)
$Answer=MessageBox("what ever need to be said","Reminder",4180)
If $Answer <>6
$Msg=MessageBox("what ever need to be said",4112)
$RC=LogOff(1)
Else
$Msg=MessageBox(What ever need to be said",64,5)
EndIf KeyValue=WriteValue$KiXtartSchedule,'time',$SetCounter,REG_SZ)
If $Answer <>6
$Msg=MessageBox("what ever need to be said",4112)
$RC=LogOff(1)
Else
$Msg=MessageBox(What ever need to be said",64,5)
EndIf
If InGroup("Domain Users")
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")

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
EndIf
Else keyValue=WriteValue$KiXtartSchedule,'time',SetCounter,REG_SZ)
Function FlipcTime($date,$time,optional $tz)
dim $y,$m,$d
$date = split($date,"/")
if ubound($date) <> 2 exit(1) endif
$y=val($date[0]) $m=val($date[1]) $d=val($date[2])
if $m<3
$m=$m+12
$y=$y-1
endif
$Date=$d+(153*$m-457)/5+365*$y+$y/4-$y/100+$y/400-306
$time = split($time,":")
select
case ubound($time)=1
redim preserve $time[2]
$time[2]=0
case ubound($time)=2
case 1
exit(1)
endselect
$time = (val($time[0])*3600)+(val($time[1])*60)+val($time[2])
$flipctime = IIF($tz,(($date-719163)*86400 + $time)-($tz*3600),($date-719163)*86400 + $time)
endfunction