Advertisement
Guest User

Untitled

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