Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.85 KB | None | 0 0
  1. #cs ----------------------------------------------------------------------------
  2.  
  3.     AutoIt Version: 3.3.6.1
  4.     Author:         SpyTec
  5.  
  6.     Script Function:
  7.     Template AutoIt script.
  8.  
  9. #ce ----------------------------------------------------------------------------
  10. #RequireAdmin
  11. #include <ButtonConstants.au3>
  12. #include <GUIConstantsEx.au3>
  13. #include <ProgressConstants.au3>
  14. #include <WindowsConstants.au3>
  15. Opt('MustDeclareVars', 1)
  16. GLobal $p = 0
  17. LoginForm()
  18.  
  19. Func LoginForm()
  20.     Local $LoginForm, $RestoreKey, $DeleteKey, $DeleteLogin, $Progress1, $RestoreLogin, $msg, $p
  21.  
  22.     $LoginForm = GUICreate("Login Background Changes", 274, 137, 196, 121)
  23.     $RestoreKey = GUICtrlCreateButton("Restore Registry Key", 16, 56, 113, 33)
  24.     $DeleteKey = GUICtrlCreateButton("Delete Registry Key", 16, 16, 113, 33)
  25.     $DeleteLogin = GUICtrlCreateButton("Delete Login BG", 144, 16, 113, 33)
  26.     $Progress1 = GUICtrlCreateProgress(16, 96, 241, 25)
  27.     $RestoreLogin = GUICtrlCreateButton("Restore Login BG", 144, 56, 113, 33)
  28.     GUISetState()
  29.  
  30.     Do
  31.         $msg = GUIGetMsg()
  32.             If $msg = $RestoreKey Then RecKey()
  33.             If $msg = $DeleteKey Then DelKey()
  34.             If $msg = $DeleteLogin Then OobeCnD()
  35.             If $msg = $RestoreLogin Then OobeCnR()
  36.         Until $Progress1 = 100
  37.     If $Progress1 = 100 Then Exit
  38.  
  39. EndFunc   ;==>LoginForm
  40.  
  41. Func RecKey()
  42.     Local $LBG, $rec, $Progress1, $p
  43.     $rec = RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background", "OEMBackground", "REG_DWORD", "1")
  44.     If $rec = 0 Then MsgBox(048, "Error", "Unable to restore keys at error: " & @error)
  45.     For $Progress1 = $p to 100 Step 100
  46.         If $Progress1 = 100 Then SoundPlay(@WindowsDir  & "\Media\Windows - ding.wav", 1)
  47.         GUICtrlSetData($Progress1, $p)
  48.     Next
  49.     If $Progress1 = 100 Then Exit
  50. EndFunc   ;==>RecKey
  51.  
  52. Func DelKey()
  53.     Local $LBG, $del, $ex
  54.     $del = RegDelete($LBG, "OEMBackground")
  55.     $ex = $LBG & "\OEMBackground"
  56.     If $del = 0 Then MsgBox(048, "Error", "Unable to delete selected registry keys at: " & $ex)
  57. EndFunc   ;==>DelKey
  58.  
  59. Func OobeCnD()
  60.     Local $CnD_copy, $CnD_CEr, $CnD_del
  61.     $CnD_copy = DirCopy("C:\Windows\System32\oobe\Info", @ScriptDir & "\Info", 1)
  62.     If $CnD_copy = 0 Then $CnD_CEr = MsgBox(4144, "Failure", "Couldn't copy source dir.")
  63.     If $CnD_CEr = 1 Then Exit
  64.     $CnD_del = DirRemove("C:\Windows\System32\oobe\Info", 1)
  65.     If $CnD_del = 0 Then $CnD_CEr = MsgBox(4144, "Failure", "Couldn't copy source dir.")
  66.     If $CnD_CEr = 1 Then Exit
  67. EndFunc   ;==>OobeCnD
  68.  
  69. Func OobeCnR()
  70.     Local $CnR_copy, $CnR_CEr, $CnR_del
  71.     $CnR_copy = DirCopy(@ScriptDir & "\Info", "C:\Windows\System32\oobe\Info", 1)
  72.     If $CnR_copy = 0 Then $CnR_CEr = MsgBox(4144, "Failure", "Couldn't copy source dir.")
  73.     If $CnR_CEr = 1 Then Exit
  74.     $CnR_del = DirRemove(@ScriptDir & "\Info", 1)
  75.     If $CnR_del = 0 Then $CnR_CEr = MsgBox(4144, "Failure", "Couldn't copy source dir.")
  76.     If $CnR_del = 1 Then Exit
  77. EndFunc   ;==>OobeCnR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement