Sign in to follow this  
Followers 0
Dead

Windows Backup

3 posts in this topic

Credit goes to Noobster24 for Serializer

Credit goes to Christopher L. Greer @ www.SiginetSoftware.com for DriverGrabber Backup Windows Drivers

This Script will currently backup:

My Documents Folder

Shared Documents Folder

Users IE Favorites

Desktop

Ms Outlook

Ms Outlook Express

Flashget Download Manager Settings & Database

Firefox Profile

Complete Registry Backup

All Device Drivers (DriverGrabber)

Windows Licenses (Serializer)

Compress Backup (7za)

Requirements:

Autoit Beta

7za + 7zCon.sfx

DriverGrabber

Serializer

All Requirements: included in Backup.7z

Backup.7z

#NoTrayIcon
#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=Backup.exe
#AutoIt3Wrapper_Compression=4
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#include <GuiEdit.au3>
#include <Array.au3>

local $Destination

$Form1 = GUICreate("Backup", 622, 450, 193, 125)
$Label1 = GUICtrlCreateLabel("Backup Destination:", 4, 12, 175, 19, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 11, 400, 0, "Lucida Console")
$Input1 = GUICtrlCreateInput("", 184, 11, 353, 23)
GUICtrlSetFont(-1, 11, 400, 0, "Lucida Console")
$Button1 = GUICtrlCreateButton("Browse", 540, 10, 75, 25, 0)
GUICtrlSetFont(-1, 11, 400, 0, "Lucida Console")
$Edit1 = GUICtrlCreateEdit("", 4, 40, 613, 369, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
GUICtrlSetFont(-1, 11, 400, 0, "Lucida Console")
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
_GUICtrlEdit_SetReadOnly($Edit1, True)
$BACKUP = GUICtrlCreateButton("Backup", 460, 416, 75, 25, 0)
GUICtrlSetFont(-1, 11, 400, 0, "Lucida Console")
$Exit = GUICtrlCreateButton("Exit", 540, 416, 75, 25, 0)
GUICtrlSetFont(-1, 11, 400, 0, "Lucida Console")
$Checkbox1 = GUICtrlCreateCheckbox("Compress Backup", 8, 420, 157, 17)
GUICtrlSetFont(-1, 11, 400, 0, "Lucida Console")
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            _Exitcode()
        Case $Exit
            _Exitcode()
        Case $Button1
            _BackupDestination()
        Case $BACKUP
            _MyDocuments()
            _SharedDocuments()
            _Favorites()
            _Desktop()
            _MsOutlook()
            _MsOutlookExpress()
            _Flashget()
            _Firefox()
            _Registry()
            _DeviceDrivers()
            _Licenses()
        If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then; Must Always Be Last
            _Compress()
        EndIf
    EndSwitch
WEnd

Func _Exitcode()
    GUIDelete()
    Exit
EndFunc

Func _BackupDestination()
    $Destination = FileSelectFolder("Select backup destination", "" , 7)
    GUICtrlSetData($Input1 , $Destination)
EndFunc

Func _MyDocuments()
    local $MyDocuments = @MyDocumentsDir
    local $FolderArray1 = _FileListToArray($MyDocuments & "\", "*", 2)
    $1 = _ArraySearch($FolderArray1, "RECYCLER")
    _ArrayDelete($FolderArray1, $1)
    $Num = $FolderArray1[0]
    $FolderArray1[0] = $Num - 1
    $2 = _ArraySearch($FolderArray1, "System Volume Information")
    _ArrayDelete($FolderArray1, $2)
    $Num = $FolderArray1[0]
    $FolderArray1[0] = $Num - 1
    GuiCtrlSetData($Edit1, "Backing Up Current Users My Documents" & @CRLF, 1)
    DirCreate($Destination & "\My Documents")
    FileCopy($MyDocuments & "\*.*", $Destination & "\My Documents", 8)
    For $1 = 1 To $FolderArray1[0]
    DirCopy($MyDocuments & "\" & $FolderArray1[$1], $Destination & "\My Documents\" & $FolderArray1[$1], 1)
    Next
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
EndFunc

Func _SharedDocuments()
    local $SharedDocuments = @DocumentsCommonDir
    GuiCtrlSetData($Edit1, @CRLF, 1)
    GuiCtrlSetData($Edit1, "Backing Up Shared Documents" & @CRLF, 1)
    DirCreate($Destination & "\Shared Documents")
    DirCopy($SharedDocuments, $Destination & "\Shared Documents", 1)
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
EndFunc

Func _Favorites()
    local $Favorites = @UserProfileDir & "\Favorites"
    GuiCtrlSetData($Edit1, @CRLF, 1)
    GuiCtrlSetData($Edit1, "Backing Up Current Users IE Favorites" & @CRLF, 1)
    DirCreate($Destination & "\Favorites")
    DirCopy($Favorites, $Destination & "\Favorites", 1)
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
EndFunc

Func _Desktop()
    local $Desktop = @UserProfileDir & "\Desktop"
    GuiCtrlSetData($Edit1, @CRLF, 1)
    GuiCtrlSetData($Edit1, "Backing Up Current Users Desktop" & @CRLF, 1)
    DirCreate($Destination & "\Desktop")
    DirCopy($Desktop, $Destination & "\Desktop", 1)
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
EndFunc

Func _MsOutlook()
    local $Outlook = @UserProfileDir & "\Local Settings\Application Data\Microsoft\Outlook"
    If FileExists($Outlook) = 1 Then
    GuiCtrlSetData($Edit1, @CRLF, 1)
    GuiCtrlSetData($Edit1, "Backing Up Current Users Microsoft Outlook Data" & @CRLF, 1)
    DirCreate($Destination & "\Microsoft Outlook")
    DirCopy($Outlook, $Destination & "\Microsoft Outlook", 1)
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
    EndIf
EndFunc

Func _MsOutlookExpress()
    local $OutlookExpress = @UserProfileDir & "\Local Settings\Application Data\Identities" 
    If FileExists($OutlookExpress) = 1 Then
    GuiCtrlSetData($Edit1, @CRLF, 1)
    GuiCtrlSetData($Edit1, "Backing Up Current Users Microsoft Outlook Express Data" & @CRLF, 1)
    DirCreate($Destination & "\Microsoft Outlook Express")
    RunWait(@Comspec & ' /c REG EXPORT "HKEY_CURRENT_USER\Identities" ' & '"' & $Destination & '\Microsoft Outlook Express\Settings.reg"', "", @SW_HIDE)
    DirCopy($OutlookExpress, $Destination & "\Microsoft Outlook Express", 1)
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
    EndIf
EndFunc

Func _Flashget()
    local $Flashget = @ProgramFilesDir & "\FlashGet"
    If FileExists($Flashget) = 1 Then
    GuiCtrlSetData($Edit1, @CRLF, 1)
    GuiCtrlSetData($Edit1, "Backing Up FlashGet Settings" & @CRLF, 1)
    DirCreate($Destination & "\FlashGet")
    FileCopy($Flashget & "\*.jcd", $Destination & "\FlashGet",1)
    RunWait(@Comspec & ' /c REG EXPORT "HKCU\Software\JetCar" ' & '"' & $Destination & '\FlashGet\Profile.reg"', "", @SW_HIDE)
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
    EndIf
EndFunc


Func _Firefox()
    local $Firefox = @AppDataDir & "\Mozilla"
    If FileExists($Firefox) = 1 Then
    GuiCtrlSetData($Edit1, @CRLF, 1)
    GuiCtrlSetData($Edit1, "Backing Up Firefox Profile" & @CRLF, 1)
    DirCreate($Destination & "\Firefox")
    If ProcessExists("firefox.exe") Then
    ProcessClose("firefox.exe")
    EndIf
    DirCopy($Firefox, $Destination & "\Firefox", 1)
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
    EndIf
EndFunc

Func _Registry()
    GuiCtrlSetData($Edit1, @CRLF, 1)
    GuiCtrlSetData($Edit1, "Backing Up Registry" & @CRLF, 1)
    DirCreate($Destination & "\Registry")
    RunWait("regedit /S /E " & $Destination & "\Registry\Registry.reg")
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
EndFunc

Func _DeviceDrivers()
    local $Drivers = @HomeDrive & "\Device_Drivers"
    DirCreate($Drivers)
    FileInstall("tools\DriverGrabber.exe", $Drivers & "\DriverGrabber.exe", 1)
    FileInstall("tools\DriverGrabber.ini", $Drivers & "\DriverGrabber.ini", 1)
    GuiCtrlSetData($Edit1, @CRLF, 1)
    GuiCtrlSetData($Edit1, "Backing Up Device Drivers" & @CRLF, 1)
    DirCreate($Destination & "\Drivers")
    RunWait($Drivers & "\DriverGrabber.exe")
    DirCopy($Drivers & "\Drivers", $Destination & "\Drivers", 1)
    FileCopy($Drivers & "\DriverGrabber.log", $Destination & "\Drivers", 1)
    DirRemove($Drivers, 1)
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
EndFunc

Func _Licenses()
    local $Licenses = @HomeDrive & "\Licenses"
    DirCreate($Licenses)
    FileInstall("tools\serializersilent.exe", $Licenses & "\serializersilent.exe", 1)
    FileInstall("tools\serializer_software.ini", $Licenses & "\serializer_software.ini", 1)
    GuiCtrlSetData($Edit1, @CRLF, 1)
    GuiCtrlSetData($Edit1, "Backing Up Windows Licenses" & @CRLF, 1)
    DirCreate($Destination & "\Licenses")
    RunWait($Licenses  & "\serializersilent.exe")
    FileCopy($Licenses & "\Serial.txt", $Destination & "\Licenses", 1)
    DirRemove($Licenses, 1)
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
EndFunc

Func _Compress()
    local $7zip = @HomeDrive & "\7zip"
    DirCreate($7zip)
    FileInstall("tools\7za.exe", $7zip & "\7za.exe", 1)
    FileInstall("tools\7zCon.sfx", $7zip & "\7zCon.sfx", 1)
    GuiCtrlSetData($Edit1, @CRLF, 1)
    GuiCtrlSetData($Edit1, "Compressing Backup" & @CRLF, 1)
    RunWait($7zip & "\7za a -r -y -sfx7zCon.sfx "& $Destination & "\Backup.exe " & $Destination & "\*.* ", "", @SW_HIDE)
    DirRemove($7zip, 1)
    GuiCtrlSetData($Edit1, "---> Complete" & @CRLF, 1)
EndFunc

Share this post


Link to post
Share on other sites



Thanks for adding to my idea! lol, all i wanted to do was do a lame backup of favorites in IE. dummy me forgot about the registry (only slightly important :x) ).

I am going to go check out drivergrabber asap!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0