; Matt's Script to backup/restore Outlook settings. #requireadmin #include Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) _Main() Func _Main() Local $BackupID, $RestoreID GUICreate("Outlook Settings Monster", 300, 60) GUICtrlCreateLabel("Please select the option you require, kind sage.", 40, 5) GUICtrlCreateLabel("Matt Stevenson - 2011", 192, 48) $BackupID = GUICtrlCreateButton("Backup", 95, 25, 50, 20) GUICtrlSetOnEvent($BackupID, "OnBackup") $RestoreID = GUICtrlCreateButton("Restore", 155, 25, 50, 20) GUICtrlSetOnEvent($RestoreID, "OnRestore") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") GUISetState() ; display the GUI While 1 Sleep(1000) WEnd EndFunc ;==>_Main ;--------------- Functions --------------- Func OnBackup() Local $FileName $FileName=@ScriptDir & "\Outlook.reg" RunWait(@COMSPEC & " /c " & 'REG EXPORT ' & '"HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook" ' & $FileName & ' /y') MsgBox(0, "Backup...", "Backing up to " & $FileName & ".") EndFunc ;==>OnBackup Func OnRestore() Local $FileName $FileName=@ScriptDir & "\Outlook.reg" if not FileExists($FileName) then Msgbox (0,"Restore...","A cannae restore any'hin', because you haven't yet created the "& $FileName & " file.") elseif FileExists($FileName) then ShellExecuteWait($Filename) ;MsgBox (0, "File Exists!", "File Exists!") endif EndFunc ;==>OnRestore Func OnExit() Exit EndFunc ;==>OnExit