#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: SpyTec Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- #RequireAdmin #include #include #include #include Opt('MustDeclareVars', 1) GLobal $p = 0 LoginForm() Func LoginForm() Local $LoginForm, $RestoreKey, $DeleteKey, $DeleteLogin, $Progress1, $RestoreLogin, $msg, $p $LoginForm = GUICreate("Login Background Changes", 274, 137, 196, 121) $RestoreKey = GUICtrlCreateButton("Restore Registry Key", 16, 56, 113, 33) $DeleteKey = GUICtrlCreateButton("Delete Registry Key", 16, 16, 113, 33) $DeleteLogin = GUICtrlCreateButton("Delete Login BG", 144, 16, 113, 33) $Progress1 = GUICtrlCreateProgress(16, 96, 241, 25) $RestoreLogin = GUICtrlCreateButton("Restore Login BG", 144, 56, 113, 33) GUISetState() Do $msg = GUIGetMsg() If $msg = $RestoreKey Then RecKey() If $msg = $DeleteKey Then DelKey() If $msg = $DeleteLogin Then OobeCnD() If $msg = $RestoreLogin Then OobeCnR() Until $Progress1 = 100 If $Progress1 = 100 Then Exit EndFunc ;==>LoginForm Func RecKey() Local $LBG, $rec, $Progress1, $p $rec = RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", "REG_DWORD", "1") If $rec = 0 Then MsgBox(048, "Error", "Unable to restore keys at error: " & @error) For $Progress1 = $p to 100 Step 100 If $Progress1 = 100 Then SoundPlay(@WindowsDir & "\Media\Windows - ding.wav", 1) GUICtrlSetData($Progress1, $p) Next If $Progress1 = 100 Then Exit EndFunc ;==>RecKey Func DelKey() Local $LBG, $del, $ex $del = RegDelete($LBG, "OEMBackground") $ex = $LBG & "\OEMBackground" If $del = 0 Then MsgBox(048, "Error", "Unable to delete selected registry keys at: " & $ex) EndFunc ;==>DelKey Func OobeCnD() Local $CnD_copy, $CnD_CEr, $CnD_del $CnD_copy = DirCopy("C:\Windows\System32\oobe\Info", @ScriptDir & "\Info", 1) If $CnD_copy = 0 Then $CnD_CEr = MsgBox(4144, "Failure", "Couldn't copy source dir.") If $CnD_CEr = 1 Then Exit $CnD_del = DirRemove("C:\Windows\System32\oobe\Info", 1) If $CnD_del = 0 Then $CnD_CEr = MsgBox(4144, "Failure", "Couldn't copy source dir.") If $CnD_CEr = 1 Then Exit EndFunc ;==>OobeCnD Func OobeCnR() Local $CnR_copy, $CnR_CEr, $CnR_del $CnR_copy = DirCopy(@ScriptDir & "\Info", "C:\Windows\System32\oobe\Info", 1) If $CnR_copy = 0 Then $CnR_CEr = MsgBox(4144, "Failure", "Couldn't copy source dir.") If $CnR_CEr = 1 Then Exit $CnR_del = DirRemove(@ScriptDir & "\Info", 1) If $CnR_del = 0 Then $CnR_CEr = MsgBox(4144, "Failure", "Couldn't copy source dir.") If $CnR_del = 1 Then Exit EndFunc ;==>OobeCnR