#include #include #include #include #RequireAdmin #Region ### START Koda GUI section ### Form=h:\autoit\gui's for programs\savereg 2.kxf $Form1 = GUICreate("SaveReg", 298, 147, -1, -1) $Hardware = GUICtrlCreateCheckbox("Hardware", 13, 8, 97, 17) $Sam = GUICtrlCreateCheckbox("Sam", 13, 24, 97, 17) $Security = GUICtrlCreateCheckbox("Security", 13, 39, 97, 17) $Software = GUICtrlCreateCheckbox("Software", 13, 55, 97, 17) $System = GUICtrlCreateCheckbox("System", 13, 71, 97, 17) $Button2 = GUICtrlCreateButton("Save", 221, 120, 75, 25) $Graphic1 = GUICtrlCreateGraphic(110, 6, 17, 20) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0x00FF00) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 2, 5, 10, 10) $Graphic2 = GUICtrlCreateGraphic(110, 21, 16, 19) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0x00FF00) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 2, 5, 10, 10) $Graphic3 = GUICtrlCreateGraphic(110, 36, 16, 19) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0x00FF00) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 2, 5, 10, 10) $Graphic4 = GUICtrlCreateGraphic(110, 51, 16, 19) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0x00FF00) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 2, 5, 10, 10) $Graphic5 = GUICtrlCreateGraphic(110, 68, 16, 19) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0x00FF00) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 2, 5, 10, 10) $Graphic6 = GUICtrlCreateGraphic(110, 6, 17, 20) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFF0000) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 2, 5, 10, 10) $Graphic7 = GUICtrlCreateGraphic(110, 21, 16, 19) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFF0000) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 2, 5, 10, 10) $Graphic8 = GUICtrlCreateGraphic(110, 36, 16, 19) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFF0000) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 2, 5, 10, 10) $Graphic9 = GUICtrlCreateGraphic(110, 51, 16, 19) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFF0000) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 2, 5, 10, 10) $Graphic10 = GUICtrlCreateGraphic(110, 68, 16, 19) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFF0000) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 2, 5, 10, 10) $Label1 = GUICtrlCreateLabel("Status :", 12, 128, 36, 17) $Label2 = GUICtrlCreateLabel("", 51, 128, 156, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $SaveFolder =""&@ScriptDir&"\" Global $RegFile While 1 $nMsg = GUIGetMsg() Sleep(20) if GUICtrlRead($Hardware) = 1 Then GUICtrlSetState($Graphic6, 16) EndIf if GUICtrlRead($Sam) = 1 Then GUICtrlSetState($Graphic7, 16) EndIf if GUICtrlRead($Security) = 1 Then GUICtrlSetState($Graphic8, 16) EndIf if GUICtrlRead($Software) = 1 Then GUICtrlSetState($Graphic9, 16) EndIf if GUICtrlRead($System) = 1 Then GUICtrlSetState($Graphic10, 16) EndIf Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 Save() EndSwitch WEnd Func Browse() $SaveFolder = FileSelectFolder("Browse For Save Directory", @ScriptDir) If @error Then $SaveFolder =""&@ScriptDir&"\" EndIf EndFunc Func Save() Browse() If GUICtrlRead($Hardware) = "1" Then $RegFile="HARDWARE" Call("RunCommand") GUICtrlSetState($Graphic6, 32) GUICtrlSetState($Hardware, 4) GUICtrlSetData($Label2, "Saving " & $RegFile) EndIf If GUICtrlRead($Sam) = "1" Then $RegFile="SAM" Call("RunCommand") GUICtrlSetState($Graphic7, 32) GUICtrlSetState($Sam, 4) GUICtrlSetData($Label2, "Saving " & $RegFile) EndIf If GUICtrlRead($Security) = "1" Then $RegFile="SECURITY" Call("RunCommand") GUICtrlSetState($Graphic8, 32) GUICtrlSetState($Security, 4) GUICtrlSetData($Label2, "Saving " & $RegFile) EndIf If GUICtrlRead($Software) = "1" Then $RegFile="SOFTWARE" Call("RunCommand") GUICtrlSetState($Graphic9, 32) GUICtrlSetState($Software, 4) GUICtrlSetData($Label2, "Saving " & $RegFile) EndIf If GUICtrlRead($System) = "1" Then $RegFile="SYSTEM" Call("RunCommand") GUICtrlSetState($Graphic10, 32) GUICtrlSetState($System, 4) GUICtrlSetData($Label2, "Saving " & $RegFile) EndIf GUICtrlSetData($Label2, "Saving Complete") EndFunc Func RunCommand() RunWait(@ComSpec & " /c Reg Save HKLM\" & $RegFile & " " & $RegFile, $SaveFolder, @SW_HIDE) EndFunc