R2D2,
Expanding your code. Note: the implementation of COMPAREFILETIMES..
code:
;Check if outlook is installed
$outlook=READVALUE("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE","")
$outlookexist = Exist($outlook)
IF ($outlookexist)
GOTO copy_stationery
ELSE
GOTO End
;
:copy_stationery
$appdata=READVALUE("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\","AppData")
$userprofile1 = $appdata+"\Microsoft\Stationery\"
$local = "$Userprofile1" + "CorpStationery.htm"
$logon = @ldrive + "\Stationery\" + "CorpStationery.htm"
;
; start here
IF Exist ($local) = 0
SHELL "%COMSPEC% /E:1024 /C COPY " + $logon $userprofile1
ELSE
IF COMPAREFILETIMES($local, $logon)
SHELL "%COMSPEC% /E:1024 /C COPY " + $logon $userprofile1
ENDIF
ENDIF
;Note: Never did find the missing endif here
ENDIF
Now, if we take Jochen's suggestion..
code:
;Check if outlook is installed
$outlook=READVALUE("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE","")
$outlookexist = Exist($outlook)
IF ($outlookexist)
GOTO copy_stationery
ELSE
GOTO End
;
:copy_stationery
$appdata=READVALUE("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\","AppData")
$userprofile1 = $appdata+"\Microsoft\Stationery\"
$local = $userprofile1 + "CorpStationery.htm"
$logon = @ldrive + "\Stationery\CorpStationery.htm"
;
; start here
IF Exist ($local) = 0
COPY $logon "$Userprofile1"
ELSE
IF COMPAREFILETIMES($local, $logon)
COPY $logon "$Userprofile1"
ENDIF
ENDIF
;Note: Never did find the missing endif here
ENDIF
Does this work?
Kent
[ 22. May 2003, 14:48: Message edited by: kdyer ]