Jump to content



Photo

Windows User files back up and restore


  • Please log in to reply
11 replies to this topic

#1 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 17 February 2011 - 10:44 PM

This is a little program that I threw together to use at work when I have to back up a user's information. The program allows you to select a user from a drop down list and back up some of their files to a location of your choosing.

Where I work we have 2 types of users, Redirects which are users that are on Desktops and their Desktop and My Documents are redirected to our File Print Server, and non-redirects usually laptop users where their profiles aren't redirected (obviously). There is a set of 2 radio buttons that allow you to select Redirect or Non-Redirect, the Redirect button only backs up the user's Favorites, their Outlook contacts, and any PST files it finds in their profile folder. Non-Redirect backs those up as well as their Desktop folder and My Documents.

This has been written to be usable under Windows XP and above and uses Xcopy to perform the copy. I used Xcopy to keep the code smaller as it does the copy process and will create the folders necessary without having to go through the trouble of using a recursive file routine and arrays. My philosophy is don't reinvent the wheel; when I have a tool that does what I need it to do, why remake one that does it slower?

The program also has the option of creating a log file of the files that were copied as well as any errors that were encountered. The location that this file is saved to is the folder you select in the Input field.

I don't know how useful this will be to everyone, but it has some interesting methods for doing what it does. Please let me know if you have any issues with it.

This program uses Melba23's ExtMsgBox UDF as well as a trick I found to color the Radio buttons that AdmiralAlkex posted HERE showing how to disable the Windows theme on a per control basis.


AutoIt         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <File.au3> #include <Array.au3> #include <ExtMsgBox.au3> #include <EditConstants.au3> Opt("GUIOnEventMode", 1) Opt("Mustdeclarevars", 1) Opt("GUICloseOnESC", 0) Global $Backup, $Restore, $SavePath, $CopyPath[5], $Search, $LogType, $I Global $X = 0, $NewOS, $UserName1, $Form2, $strPrompt1, $aUserList[10] Global $ArrayItem, $Log, $LogFlag, $LogFile, $LogPath, $UserList[10] Global $Icon, $Button, $Title, $Text, $Timeout, $Pos, $Vpos Global $strSavePath, $Redirect, $NonRedirect, $Loop, $Success = False Global $strLocation, $OK, $strPrompt, $Split, $sUserList[3] If @OSVersion == "WIN_7" Or @OSVersion == "WIN_VISTA" Or @OSVersion = "WIN_2008" Then     $NewOS = True ElseIf @OSVersion == "WIN_XP" Then     $NewOS = False Else     _MsgBox($MB_ICONexclam, "&OK", "Wrong OS", "This Script only works on Windows XP and up, it can't be used on this version of Windows.", $Timeout, $Pos, $Vpos)     Exit EndIf If Not $NewOS Then     $UserList = _FileListToArray("C:\Documents and Settings", "*.*", 2)     For $I = 1 To $UserList[0]         Select             Case $UserList[$I] = "All Users"             Case $UserList[$I] = "Default User"             Case $UserList[$I] = "NetworkService"             Case $UserList[$I] = "LocalService"             Case $UserList[$I] = "Administrator"             Case Else                 $aUserList[$X] = $UserList[$I]                 $X += 1                 If $X >= UBound($aUserList) Then                     ReDim $aUserList[UBound($aUserList) + 10]                 EndIf         EndSelect     Next Else     $UserList = _FileListToArray("C:\Users", "*.*", 2)     For $I = 1 To $UserList[0]         Select             Case $UserList[$I] = "All Users"             Case $UserList[$I] = "Default"             Case $UserList[$I] = "Default User"             Case $UserList[$I] = "Public"             Case Else                 $aUserList[$X] = $UserList[$I]                 $X += 1                 If $X >= UBound($aUserList) Then                     ReDim $aUserList[UBound($aUserList) + 10]                 EndIf         EndSelect     Next EndIf ReDim $aUserList[$X] $sUserList = _ArrayToString($aUserList, "|") #Region ### START Koda GUI section ### Form=Form1 Global $Form1 = GUICreate("Backup and Restore", 629, 350, 314, 132) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") GUISetBkColor(0x4D689A, $Form1) ;  Create Ok button GUICtrlCreateButton("&OK", 528, 70, 75, 25) GUICtrlSetState(-1, $GUI_FOCUS) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetOnEvent(-1, "OKButton1Click") ;  Create Cancel button GUICtrlCreateButton("Cancel", 528, 150, 75, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetOnEvent(-1, "CancelButton1Click") ;Create Help button 1 GUICtrlCreateButton("Help", 528, 230, 75, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetOnEvent(-1, "HelpButton1Click") ;  Create group control Global $Group1 = GUICtrlCreateGroup("", 32, 10, 473, 320) Global $Radio1 = GUICtrlCreateRadio("Restore?", 128, 30, 113, 17) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Radio1), "wstr", 0, "wstr", 0) GUICtrlSetColor(-1, 0xff8040) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetTip(-1, "Restore user files from backup?") Global $Radio2 = GUICtrlCreateRadio("Backup?", 312, 30, 91, 17) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Radio2), "wstr", 0, "wstr", 0) GUICtrlSetColor(-1, 0xff8040) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetTip(-1, "Backup user files?") Global $Input1 = GUICtrlCreateInput("", 80, 130, 321, 22) GUICtrlSetTip(-1, "Drive location") ;  Create browse button GUICtrlCreateButton("Browse", 408, 130, 43, 17) GUICtrlSetTip(-1, "Browse for path") GUICtrlSetOnEvent(-1, "BrowseButtonclick") ;  Create Label1 GUICtrlCreateLabel("Enter the location that your back ups are located or where you want to save them to.", 88, 80, 350, 33) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xff8040) GUICtrlCreateLabel("Select the user to process", 88, 170, 350, 33) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xff8040) Global $UserName = GUICtrlCreateCombo("", 80, 190, 177, 25) GUICtrlSetTip(-1, "Select User to back up/restore!") GUICtrlSetData(-1, $sUserList) Global $Log = GUICtrlCreateCheckbox("Do you want to keep a log of this?", 80, 300, 209, 17) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Log), "wstr", 0, "wstr", 0) GUICtrlSetColor(-1, 0xff8040) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUIStartGroup() Global $Radio3 = GUICtrlCreateRadio("Redirect?", 128, 250, 113, 17) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Radio3), "wstr", 0, "wstr", 0) GUICtrlSetColor(-1, 0xff8040) GUICtrlSetTip(-1, "Only back up PST files, Favorites and Outlook contacts") Global $Radio4 = GUICtrlCreateRadio("Non-Redirect?", 312, 250, 113, 17) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Radio4), "wstr", 0, "wstr", 0) GUICtrlSetColor(-1, 0xff8040) GUICtrlSetTip(-1, "Back up PST files, Favorites, Desktop, Documents, and Outlook contacts") GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $strPrompt = "This script is used to backup and restore the standard user folders on a Windows computer to an external drive." & @CRLF $strPrompt &= "It will try to write to or read from the logged on user's network shared drive or any other valid drive" & @CRLF $strPrompt &= "letter including USB drives." & @CRLF & "It is compatible with Windows XP/Vista/Windows 7/Server 2003/Server 2008." $strPrompt &= @CRLF & "As the script is written, it will back up and restore the following folders." & @CRLF $strPrompt &= @CRLF & """My Documents"" or ""Documents""" & @CRLF & """Desktop""" & @CRLF & """Favorites""" & @CRLF $strPrompt &= "plus any ""*.pst"" files and Outlook contacts stored in the user's profile." & @CRLF $strPrompt &= @CRLF & @CRLF & "When selecting the location to restore from please select the folder that the back up folder is saved to, and not the folder with the user's name." $strPrompt &= @CRLF & @CRLF & "Example: Back ups are saved to the ""E:"" drive in the folder called ""Backups"", and the user's name is ""Jim"" (E:\Backups\Jim)" $strPrompt &= @CRLF & "Select the folder ""E:\Backups"" and not the ""E:\Backups\Jim"" folder." While 1     Sleep(100) WEnd #Region BUR Functions #cs     ;===========================================================================     Checks the chosen path to see if it exists, and if it can be     written to if backing up, or it checks to see that the     restore folder is where you said it was.     ;=========================================================================== #ce Func _CheckValidPaths()     Local $TestFile, $Test     If $Restore = 1 Then         If Not FileExists($strLocation) Then             GUISetState(@SW_HIDE)             _MsgBox($MB_ICONexclam, "&OK", "Restore - Bad Path", "The path you selected " & "'" & $strLocation & "'" & " doesn't contain any back ups for the selected user, please try again", $Timeout, $Pos, $Vpos)             GUISetState(@SW_SHOW)             Return -1         EndIf     Else         $TestFile = $SavePath & "\testfile"         $Test = FileOpen($TestFile, 8)         FileClose($Test)         If Not FileExists($SavePath) Then             GUISetState(@SW_HIDE)             _MsgBox($MB_ICONexclam, "&OK", "Backup - Bad Path", "The path you selected " & "'" & $SavePath & "'" & " is an invalid path, please try again", $Timeout, $Pos, $Vpos)             GUISetState(@SW_SHOW, $Form1)             Return -1         EndIf         FileDelete($TestFile)     EndIf EndFunc   ;==>_CheckValidPaths #cs     ;===========================================================================     _CopyFiles     ;=========================================================================== #ce Func _CopyFiles(ByRef $strSearch, ByRef $ArrayItem)     Local $strRunXcopy     $strRunXcopy = " Xcopy.exe """ & $strSearch & """ """ & $SavePath _              & $CopyPath[$ArrayItem] & """ /y /s /h /i /c "     If $LogFlag = 1 Then         $strRunXcopy &= " >>" & Chr(34) & $LogPath & $LogType & Chr(34) & " 2>&1"     EndIf     RunWait(@ComSpec & " /c title " & $CopyPath[$ArrayItem] & "|" & $strRunXcopy, "", @SW_HIDE) EndFunc   ;==>_CopyFiles #cs     ;===========================================================================     ;=========================================================================== #ce Func _LogFile()     $LogFile = FileOpen($LogPath & $LogType, 2)     FileClose($LogFile) EndFunc   ;==>_LogFile #cs     ;===========================================================================     Initiates the browse for folder function and returns the path selected by     user.     ;=========================================================================== #ce Func BrowseButtonclick()     $strSavePath = FileSelectFolder("Select a drive letter or folder, don't select My Computer", _             "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 7)     GUICtrlSetData($Input1, $strSavePath) EndFunc   ;==>BrowseButtonclick #cs     ;===========================================================================     Cancel button exits the script     ;=========================================================================== #ce Func CancelButton1Click()     Exit EndFunc   ;==>CancelButton1Click #cs     ;===========================================================================     Calls the Help message box     ;=========================================================================== #ce Func HelpButton1Click()     GUISetState(@SW_HIDE)     $Icon = $MB_ICONINFO     $Button = "&OK"     $Title = "Help"     $Text = $strPrompt     Opt("MustDeclareVars", 0)     _MsgBox($Icon, $Button, $Title, $Text, $Timeout, $Pos, $Vpos)     GUISetState(@SW_SHOW, $Form1)     Opt("MustDeclareVars", 1) EndFunc   ;==>HelpButton1Click #cs     ;===========================================================================     ;=========================================================================== #ce ; ; Func OKButton1Click()     Local $Test, $SavedTo     ;   You pressed the OK button, now we are going to read your settings     $Backup = GUICtrlRead($Radio2)     $Restore = GUICtrlRead($Radio1)     $SavePath = GUICtrlRead($Input1)     $LogFlag = GUICtrlRead($Log)     $UserName1 = GUICtrlRead($UserName)     $Redirect = GUICtrlRead($Radio3)     $NonRedirect = GUICtrlRead($Radio4)     If $UserName1 <> "0" Then         Local $Split[3], $OK         $OK = False         $Split = StringSplit($sUserList, "|")         For $I In $Split             If $UserName1 = $I Then $OK = True         Next         If Not $OK Then             $Icon = $MB_ICONexclam             $Button = "OK"             $Title = "No user name selected"             $Text = "You need to select the user before starting the process. Please try again"             $Pos = $Form1             _MsgBox($Icon, $Button, $Title, $Text, $Timeout, $Pos, $Vpos)             Return         EndIf     Else         Return     EndIf     Select         Case StringLen($UserName1) = 0             $Icon = $MB_ICONexclam             $Button = "OK"             $Title = "No user name selected"             $Text = "You need to select the user before starting the process. Please try again"             $Pos = $Form1             _MsgBox($Icon, $Button, $Title, $Text, $Timeout, $Pos, $Vpos)             Return         Case $SavePath = "" ; No path selected             GUISetState(@SW_HIDE)             $Icon = $MB_ICONINFO             $Button = "&OK"             $Title = "No drive selected"             $Text = "You need to put in the save/restore path"             _MsgBox($Icon, $Button, $Title, $Text, $Timeout, $Pos, $Vpos)             GUICtrlSetData($UserName, $sUserList)             GUISetState(@SW_SHOW)             Return         Case StringLeft($SavePath, 1) = "C"             $Icon = $MB_ICONexclam             $Button = "OK"             $Title = "Don't use C: drive"             $Text = "You can't back up the files to the same drive you're copying from, ple" & _                     "ase don't select the C: drive. Please try again"             $Pos = $Form1             _MsgBox($Icon, $Button, $Title, $Text, $Timeout, $Pos, $Vpos)             Return         Case StringLen($SavePath) = 1 ; Just drive letter entered?             $SavePath &= ":\"         Case StringRight($SavePath, 1) <> "\"             $SavePath &= "\"     EndSelect     $SavePath &= $UserName1     ;===========================================================================     ;   Now that we know where you're saving the data to, we need to set some     ;   variables to tell it what folders/files to back up     ;===========================================================================     If $Backup = 1 Then         If $NewOS Then             $strLocation = "C:\Users\" & $UserName1             DirCreate($SavePath)             $LogPath = $SavePath             $LogType = "\Backup.log"         Else             $strLocation = "C:\Documents and Settings\" & $UserName1             DirCreate($SavePath)             $LogPath = $SavePath             $LogType = "\Backup.log"         EndIf     Else         If $NewOS Then             $strLocation = $SavePath             $SavePath = "C:\Users\" & $UserName1             $LogPath = $strLocation             $LogType = "\Restore.log"         Else             $strLocation = $SavePath             $SavePath = "C:\Documents and Settings\" & $UserName1             $LogPath = $strLocation             $LogType = "\Restore.log"         EndIf     EndIf     If Not $NewOS Then         $CopyPath[0] = "\Favorites"         $CopyPath[1] = "\Application Data\Microsoft\Outlook"         $CopyPath[2] = "\*.pst"         $CopyPath[3] = "\My Documents"         $CopyPath[4] = "\Desktop"     Else         $CopyPath[0] = "\Favorites"         $CopyPath[1] = "\AppData\Roaming\Microsoft\Outlook"         $CopyPath[2] = "\*.pst"         $CopyPath[3] = "\Documents"         $CopyPath[4] = "\Desktop"     EndIf     $Loop = 4     If $Redirect = 1 Then $Loop = 2     GUISetState(@SW_HIDE)     $Form2 = GUICreate("Copying!", 300, ($Loop + 1) * 50)     GUISetBkColor(0x0008000, $Form2)     GUISetState()     For $I = 0 To $Loop         GUICtrlCreateLabel(StringMid($CopyPath[$I], 2), 50, 20 + $I * 30, 230, 20)         GUICtrlSetFont(-1, Default, 800, Default)         GUICtrlSetColor(-1, 0x0FFFFFF)     Next     $Test = _CheckValidPaths()     If $Test = -1 Then Return     If $LogFlag = $GUI_CHECKED Then _LogFile()     For $ArrayItem = 0 To $Loop         $Search = $strLocation & $CopyPath[$ArrayItem]         _CopyFiles($Search, $ArrayItem)         $Search = ""         GUICtrlCreateLabel(Chr(214), 25, 20 + $ArrayItem * 30, 10, 10)         GUICtrlSetFont(-1, Default, 800, Default, "Symbol")         GUICtrlSetColor(-1, 0x0FFFFFF)         GUICtrlCreateLabel(StringMid($CopyPath[$ArrayItem], 2), 50, 20 + $ArrayItem * 30, 230, 20)         GUICtrlSetFont(-1, Default, 800, 8)         GUICtrlSetColor(-1, 0x0FFFFFF)     Next     Sleep(2000)     GUISetState(@SW_HIDE)     If $Backup = 1 Then         $SavedTo = "Your files were saved to " & $LogPath     Else         $SavedTo = "You have restored the files for " & $UserName1     EndIf     _MsgBox($MB_ICONexclam, "&OK", "Done!", "We're done!" & @CRLF & @CRLF & $SavedTo, $Timeout, $Form2, $Vpos)     GUISetState(@SW_SHOW, $Form1) EndFunc   ;==>OKButton1Click #EndRegion BUR Functions #cs     ;===========================================================================     This calls the Extended Message Box functions written by     Melba23 and added as an #include     ;=========================================================================== #ce Func _MsgBox($Icon, $Button, $Title, $Text, $iTimeout = 0, $hWin = "", $iVPos = 0)     _ExtMsgBoxSet(1, 0, 0x02616FF, 0x02AFF6A, 10, "Consolas")     _ExtMsgBox($Icon, $Button, $Title, $Text, $iTimeout, $hWin, $iVPos) EndFunc   ;==>_MsgBox Func Form1Close()     Exit EndFunc   ;==>Form1Close

  • Neutro likes this

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image








#2 Neo2102

Neo2102

    Seeker

  • Normal Members
  • 7 posts

Posted 21 June 2012 - 12:08 PM

Hello,

I love your script but I would like to know if it's possible to only backup current logged user ?

I need a script like yours for my front end user.

What I want if :

For the sources I take everyting under C:Usersblahh (current logged user)
for destination I would like to have a little popup like "please insert usb key" and when usb key is ready check the free space on it and if okay start backup ...(Full or incremental)

The user only need to put the usb key on the computer and click Go or Start when USB key is ready and they are enought free space to do bakcup

Do you know if it's difficult to do this or can you plz help me ?

Thanks

#3 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 21 June 2012 - 01:28 PM

The copy procedure is all enclosed in the OKButton1Click() function. Instead of using the information from the combobox and inputs you can get the currently logged in user's name with the @UserName macro and populate the variables using that. It's just a matter of understanding what the script is doing and modifying it to suit your needs.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#4 Iceman682

Iceman682

    Wayfarer

  • Active Members
  • Pip
  • 98 posts

Posted 17 July 2012 - 09:18 PM

Wow, this is outstanding, congratulation Sir. This is the exact script I've been searching for and I'm iching to use it but I haven't got a clue where to insert the amendments I wish to use. I want to be able to add different folder locations to backup and restore but when I insert a new line like:

If Not $NewOS Then
$CopyPath[0] = "Favorites"
$CopyPath[1] = "Application DataMicrosoftOutlook"
$CopyPath[2] = "*.nsf"
$CopyPath[3] = "My Documents"
$CopyPath[4] = "Desktop"
$CopyPath[5] = "Application DataMicrosoftSignatures"

Else
$CopyPath[0] = "Favorites"
$CopyPath[1] = "AppDataRoamingMicrosoftOutlook"
$CopyPath[2] = "*.nsf"
$CopyPath[3] = "Documents"
$CopyPath[4] = "Desktop"
$CopyPath[5] = "AppDataRoamingMicrosoftSignatures"
EndIf



I get the following error:

Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$CopyPath[5] = "AppDataRoamingMicrosoftSignatures"
^ ERROR


I didn't thing it was going to be that easy but I've just started learning this amazing find and seek some guidance please to insert more folder locations to backup and restore.

Using OS: Windows 7 64bit.

Yours in anticipation
Ian

#5 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 17 July 2012 - 09:43 PM

change the 5 in this line to however many folders you want to back up.

Global $Backup, $Restore, $SavePath, $CopyPath[5], $Search, $LogType, $I

I also forgot that you need to change the value in line 335 to this

    $Loop = 5 ; has to be one less than the number in the declaration above.

Edited by BrewManNH, 17 July 2012 - 09:46 PM.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#6 Iceman682

Iceman682

    Wayfarer

  • Active Members
  • Pip
  • 98 posts

Posted 19 July 2012 - 08:30 PM

Outstanding Sir, I followed your expert advice, however I'm still getting an error though,

Global $Backup, $Restore, $SavePath, $CopyPath[3], $Search, $LogType, $I

If Not $NewOS Then
$CopyPath[0] = "Favorites"
$CopyPath[1] = "My Documents"
$CopyPath[2] = "Desktop"
$CopyPath[3] = "Application DataMicrosoftOutlook"
Else
$CopyPath[0] = "Favorites"
$CopyPath[1] = "Documents"
$CopyPath[2] = "Desktop"
$CopyPath[3] = "AppDataRoamingMicrosoftOutlook"
EndIf
$Loop = 2


Error:

C:UsersIanDesktopCopy User Files ProjectCopy User Folders.au3 (351) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$CopyPath[3] = "AppDataRoamingMicrosoftOutlook"
^ ERROR

Am I doing something wrong?
Thanks in advance
Ian

#7 Iceman682

Iceman682

    Wayfarer

  • Active Members
  • Pip
  • 98 posts

Posted 19 July 2012 - 09:02 PM

Self Resolved,

Global $Backup, $Restore, $SavePath, $CopyPath[4], $Search, $LogType, $I

$Loop = 3

Works fine

Many thanks again Sir for this outstanding time saving tool.

Regards

#8 WhiteStar

WhiteStar

    Wayfarer

  • Active Members
  • Pip
  • 50 posts

Posted 09 November 2012 - 10:10 PM

A friendly FYI

A note in regards to Win-8 Release.

If you attempt to relocate c:Users<username>AppData or any contents within, things "will" break. Mostly Metro-Apps.
A fix is expected some time in the future, likely before SP-1 but uncertain.
This changed a little between how Vista/Win-7 handled it which was also a little different in XP.

To verify what can be moved, look into the properties of the related directories/folders under c:Users<username>. If you see the option for "Locations" in the Properties, then they can be moved but use caution.

Hope it helps
WS
~ WhiteStar Magic

#9 bonedog73

bonedog73

    Seeker

  • New Members
  • 2 posts

Posted 29 January 2013 - 05:48 PM

When trying to compile this it gives me an error on - #include <ExtMsgBox.au3> Error: Error opening the file.

I tried commenting out the ExtMsgBox line and the ExtMsgBox stuff at the bottom of the script and then it compiles and runs but when I click OK to do the backup I get an error -

Line 2161

Error: Variable used without being declard.

There isnt a line 2161



Not sure what I need to do to make this compile and work.

Any help would be appreciated.

#10 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,392 posts

Posted 29 January 2013 - 05:53 PM

bonedog73,

Download the ExtMsgBox UDF file from the link my sig and put it and the StringSize UDF file in the same folder as your script. :)

If you are going to stick around with AutoIt (and why not?) then you might find the Adding UDFs to AutoIt and SciTE tutorial in the Wiki of interest. ;)

M23
StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items


#11 bonedog73

bonedog73

    Seeker

  • New Members
  • 2 posts

Posted 29 January 2013 - 06:11 PM

Melba23,

Thanks for the quick reply! I'm now up and running! Thank you!

#12 Hdwrguy

Hdwrguy

    Seeker

  • Normal Members
  • 1 posts

Posted 08 May 2013 - 04:55 PM

This script is AWESOME!! However, I tried it to migrate a user profile from XP to Win 7 and it did everything except for the Outlook portion. Is there a specific piece of the script to modify to make this work between XP and 7?


Thanx!!!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users