Functions like WriteValue() and SetWallpaper will return a value indicating success (0) or error (<>0). They will also set @ERROR.
Commands like COPY will set @ERROR to 0 to indicate success, and <>0 for an error.
You need to check these values after each call, and display a message.
Here is one way to do it:
Code:
;Toevoegen Bureaublad Distri Logo en NTB Screensaver
$Filename = Dir("C:\program files\Distri\")
If @ERROR <> 0
MD "C:\Program files\Distri"
ShowStatus("Creating distri directory",1)
EndIf
Copy "\\MARS\C_Profiles$\distri\latitude.bmp" "c:\program files\distri\latitude.bmp"
ShowStatus("Copying latitute.bmp")
Copy "\\MARS\C_Profiles$\distri\Telecombon.scr" "c:\program files\distri\Telecombon.scr"
ShowStatus("Copying telcombon.scr")
$=SetFileAttr("c:\program files\distri", 32)
ShowStatus("Setting attributes on distri directory")
$=SetFileAttr("c:\program files\distri\Telecombon.scr", 32)
ShowStatus("Setting attributes on telecombon.scr")
$=WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","WallPaperStyle","0","REG_SZ")
ShowStatus("Setting wallpaperstyle")
$=WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","TileWallPaper","0","REG_SZ")
ShowStatus("Setting tilewallpaper")
$=WriteValue("HKEY_CURRENT_USER\Control Panel\Colors","Background","58 110 165","REG_SZ")
ShowStatus("Setting background colors")
$=SetWallpaper("C:\progra~1\distri\latitude.bmp",1)
ShowStatus("Setting wallpaper",1)
; ShowStatus()
Function ShowStatus($sMessage, Optional $bVerbose)
If @ERROR
"ERROR: "+$sMessage+@CRLF
"Reason: ["+@ERROR+"] "+@SERROR+@CRLF
Else
If $bVerbose "SUCCESS: "+$sMessage+@CRLF EndIf
EndIf
Exit @ERROR
EndFunction
Note, the second parameter to the function $bVerbose is optional. If not present (or zero) it will only report errors. If it is set to true it will report both errors and successes.