Hi Kyder

Many thanks for that I've made the following adjustments as per your suggestions and it works !. However I have a further situation where writeValue to the registry doesn't work for Domain users. I'm thinklng permissions but where ? Your's or anyone's help on this would be appreciated . many thanks

see code below


$FileHome = '\\PC01948\C$\Deployment\'
$ScriptHome = '\\PC01948\netlogon\scripts\'
$ScriptMSI = '\\PC01948\C$\Deployment\'


If NOT ReadValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Updates','Waikaremoana') = 1
SHELL '%comspec% /c runas /u:home\Administrator "msiexec /i '+$ScriptMSI+'WBC.msi" | '+$ScriptHome+'sanur /i '+$ScriptHome+'test.dat'
WriteValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Updates','Waikaremoana','1','REG_DWORD')
EndIf


$wmiColl = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM Win32_DesktopMonitor")
For Each $wmiObj In $wmiColl
Select
Case $wmiObj.DeviceID = "DesktopMonitor1"
$screenres1 = CSTR($wmiObj.ScreenWidth) + "x" + CSTR($wmiObj.ScreenHeight)
Case $wmiObj.DeviceID = "DesktopMonitor2"
$screenres2 = CSTR($wmiObj.ScreenWidth) + "x" + CSTR($wmiObj.ScreenHeight)
EndSelect
Next


select
case $screenres1 = "1024x768"
If NOT ReadValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Updates','Sheild 1024x768') = 1
SHELL '%comspec% /c runas /u:home\Administrator "msiexec /i '+$ScriptMSI+'Shield1280.msi" | '+$ScriptHome+'sanur /i '+$ScriptHome+'test.dat'
WriteValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Updates','Sheild 1024x768','1','REG_DWORD')
EndIf

case $screenres1 = "800x600"
If NOT ReadValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Updates','Sheild 800x600') = 1
SHELL '%comspec% /c runas /u:home\Administrator "msiexec /i '+$ScriptMSI+'Shield800.msi" | '+$ScriptHome+'sanur /i '+$ScriptHome+'test.dat'
WriteValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Updates','Sheild 800x600','1','REG_DWORD')
EndIf

case 1
; Must be using some other resolution
endselect


;REG_SZ

;$logfile = "\\sapdc\NETLOGON\MSI\MSI Batch Files\Citlogon.log"
;$RC = Open(1, $logfile, 5)
;$RC = WriteLine(1,"Logon Time: "+@USERID+", "+@WKSTA+", "+@Day+", "+@DATE+","+@TIME+@CRLF+)