There is a lot of fuss about how complicated it is to use. Well, I kinda agree, kinda don't, but decided to put this front end together mainly just to speed up the process. What you will need to do to use it is download the USMT Front End Extras.7z archive and extract that to @ScriptDir prior to compiling. The archive contains 32 and 64 bit versions of USMT 3.01 and USMT 4.01, as well as 7z.exe, 7z.dll, and a few simple JPGs used to pretty up the GUI a bit.
Please read the Technet docs on USMT if you have concerns about the data that it will migrate for you, as the only modification I have made to any of the XML files is to omit migrating Start Menu files, I just can't see the point of that one! Otherwise, all XMLs are bone-stock. Also be aware of the difference between USMT 3.01 and 4.01, click here for a quick reference.
I have also taken the liberty of tweaking the options used to suit my own purposes, which include creating a folder based on repair data used at my shop and specifying things such as /localonly which will exclude network shares etc. Ensure the options used here are what you need, and adjust accordingly!!
USMT Front End Extras.7z
#RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <StaticConstants.au3> ;~ User State Migration Tool Front End ;~ Coded by Ian Maxwell (llewxam @ AutoIt forum) Local $TargetBrowse, $Target, $OfflineBrowse, $OfflinePath, $CreateGoButton, $MainGUI, $RestoreGoButton, $Offline, $CustName, $RepairNumber, $Tech, $Overwrite, $NoCompress, $TimesToRetry, $SecondsToWait, $MSG $OfflineEnabled = False $XPMode = False $WhatFunction = GUICreate("USMT Front End - MaxImuM AdVaNtAgE SofTWarE 2011", 480, 150, @DesktopWidth / 2 - 240, @DesktopHeight / 2 - 15) FileInstall("right.jpg", @TempDir & "\right.jpg", 1) GUICtrlCreatePic(@TempDir & "\right.jpg", 50, 20, 160, 120) GUICtrlSetState(-1, $GUI_DISABLE) FileInstall("left.jpg", @TempDir & "\left.jpg", 1) GUICtrlCreatePic(@TempDir & "\left.jpg", 270, 20, 160, 120) GUICtrlSetState(-1, $GUI_DISABLE) $Create = GUICtrlCreateButton("CREATE Backup", 75, 62, 110, 20) $Restore = GUICtrlCreateButton("RESTORE Backup", 295, 62, 110, 20) $Question = GUICtrlCreateButton("?", 460, 0, 20, 20) GUICtrlSetBkColor(-1, 0x00f700) GUISetBkColor(0xb2ccff, $WhatFunction) GUISetState(@SW_SHOW, $WhatFunction) Do $MSG = GUIGetMsg() If $MSG == $GUI_EVENT_CLOSE Then Exit If $MSG == $Question Then _Question() If $MSG == $Create Then GUIDelete($WhatFunction) _CreateGUI() ExitLoop EndIf If $MSG == $Restore Then GUIDelete($WhatFunction) _RestoreGUI() ExitLoop EndIf Until 1 = 2 Do $MSG = GUIGetMsg() If $MSG == $GUI_EVENT_CLOSE Then Exit If $MSG == $Question Then _Question() If $MSG == $TargetBrowse Then $TargetLocation = FileSelectFolder("Choose the location to save the backup data", "", 1) GUICtrlSetData($Target, $TargetLocation) EndIf If $MSG == $OfflineBrowse Then $OfflineLocation = FileSelectFolder("Select the WINDOWS folder on the OFFLINE drive", "") GUICtrlSetData($OfflinePath, $OfflineLocation) EndIf If $MSG == $CreateGoButton Then _CreateExecute() GUIDelete($MainGUI) EndIf If $MSG == $RestoreGoButton Then _RestoreExecute() GUIDelete($MainGUI) EndIf If GUICtrlRead($Offline) == 1 And $OfflineEnabled == False Then $OfflineEnabled = True GUICtrlSetState($OfflinePath, $GUI_ENABLE) GUICtrlSetState($OfflineBrowse, $GUI_ENABLE) EndIf If GUICtrlRead($Offline) == 4 And $OfflineEnabled == True Then $OfflineEnabled = False GUICtrlSetState($OfflinePath, $GUI_DISABLE) GUICtrlSetState($OfflineBrowse, $GUI_DISABLE) EndIf Until 1 = 2 Func _CreateGUI() If @OSVersion == "WIN_XP" Then FileInstall("XPTOXP.jpg", @TempDir & "\XPTOXP.jpg", 1) FileInstall("UPGRADE.jpg", @TempDir & "\UPGRADE.jpg", 1) $ToXPGUI = GUICreate("USMT Front End - MaxImuM AdVaNtAgE SofTWarE © 2011", 480, 150, @DesktopWidth / 2 - 240, @DesktopHeight / 2 - 15) GUICtrlCreatePic(@TempDir & "\XPTOXP.jpg", 50, 20, 160, 120) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreatePic(@TempDir & "\UPGRADE.jpg", 270, 20, 160, 120) GUICtrlSetState(-1, $GUI_DISABLE) $XPToXPChoice = GUICtrlCreateButton("XP to XP", 75, 62, 110, 20) $XPToNewerChoice = GUICtrlCreateButton("XP to Vista/7", 295, 62, 110, 20) $Question = GUICtrlCreateButton("?", 460, 0, 20, 20) GUICtrlSetBkColor(-1, 0x00f700) GUISetBkColor(0xb2ccff, $ToXPGUI) GUISetState(@SW_SHOW, $ToXPGUI) Do $MSG = GUIGetMsg() If $MSG == $GUI_EVENT_CLOSE Then Exit If $MSG == $Question Then _Question() If $MSG == $XPToXPChoice Then $XPMode = True GUIDelete($ToXPGUI) ExitLoop EndIf If $MSG == $XPToNewerChoice Then GUIDelete($ToXPGUI) ExitLoop EndIf Until 1 = 2 EndIf $CreateGU = GUICreate("USMT Front End - MaxImuM AdVaNtAgE SofTWarE © 2011", 480, 400, @DesktopWidth / 2 - 240, @DesktopHeight / 2 - 200) GUICtrlCreateLabel("Specify the location to save the backup", 10, 10, 460, 20) $Target = GUICtrlCreateInput("", 10, 25, 430, 20) $TargetBrowse = GUICtrlCreateButton("...", 450, 25, 20, 20) GUICtrlCreateLabel("Customer Last Name:", 10, 55, 120, 20) $CustName = GUICtrlCreateInput("", 10, 70, 120, 20) GUICtrlCreateLabel("Repair Number:", 150, 55, 85, 20) $RepairNumber = GUICtrlCreateInput("", 150, 70, 85, 20) GUICtrlCreateLabel("Tech's Initials:", 255, 55, 85, 20) $Tech = GUICtrlCreateInput("", 255, 70, 85, 20) $Overwrite = GUICtrlCreateCheckbox("Overwrite any existing data in the save location", 10, 110, 460, 20) $NoCompress = GUICtrlCreateCheckbox("Do not compress the data (Faster)", 10, 130, 460, 20) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateLabel("Number of times to retry when an error occurs:", 10, 152, 220, 20) GUICtrlCreateLabel("(0-100, Default=3)", 270, 152, 100, 20) $TimesToRetry = GUICtrlCreateInput("3", 230, 150, 30, 20, $ES_CENTER) GUICtrlCreateLabel("Seconds to wait before retrying when an error occurs:", 10, 172, 255, 20) GUICtrlCreateLabel("(0-100, Default=1)", 305, 172, 100, 20) $SecondsToWait = GUICtrlCreateInput("1", 265, 170, 30, 20, $ES_CENTER) $Offline = GUICtrlCreateCheckbox("Specify a path for Offline recovery if not backing up this computer (NO XP TO XP!)", 10, 215, 460, 20) GUICtrlCreateLabel("IE: C;\Windows.old, E:\Windows etc", 26, 235, 460, 20) $OfflinePath = GUICtrlCreateInput("", 10, 255, 430, 20) $OfflineBrowse = GUICtrlCreateButton("...", 450, 255, 20, 20) GUICtrlSetState($OfflinePath, $GUI_DISABLE) GUICtrlSetState($OfflineBrowse, $GUI_DISABLE) $CreateGoButton = GUICtrlCreateButton("GO", 200, 320, 80, 40) GUICtrlSetFont($CreateGoButton, 12) GUICtrlCreateLabel("(You can not downgrade to Windows XP from a newer version of Windows or migrate" & @CR & "from a 64bit OS to a 32bit OS with this tool)", 10, 365, 470, 40, $SS_CENTER) $Question = GUICtrlCreateButton("?", 460, 0, 20, 20) GUICtrlSetBkColor(-1, 0x00f700) GUISetBkColor(0xb2ccff, $CreateGU) GUISetState(@SW_SHOW, $CreateGU) EndFunc ;==>_CreateGUI Func _RestoreGUI() $RestoreGUI = GUICreate("USMT Front End - MaxImuM AdVaNtAgE SofTWarE © 2011", 480, 400, @DesktopWidth / 2 - 240, @DesktopHeight / 2 - 200) GUICtrlCreateLabel("Specify the location to restore the backup from", 10, 10, 460, 20) $Target = GUICtrlCreateInput("", 10, 25, 430, 20) $TargetBrowse = GUICtrlCreateButton("...", 450, 25, 20, 20) GUICtrlCreateLabel("Number of times to retry when an error occurs:", 10, 57, 220, 20) GUICtrlCreateLabel("(0-100, Default=3)", 270, 57, 100, 20) $TimesToRetry = GUICtrlCreateInput("3", 230, 55, 30, 20, $ES_CENTER) GUICtrlCreateLabel("Seconds to wait before retrying when an error occurs:", 10, 77, 255, 20) GUICtrlCreateLabel("(0-100, Default=1)", 305, 77, 100, 20) $SecondsToWait = GUICtrlCreateInput("1", 265, 75, 30, 20, $ES_CENTER) $RestoreGoButton = GUICtrlCreateButton("GO", 200, 320, 80, 40) GUICtrlSetFont($RestoreGoButton, 12) GUICtrlCreateLabel("(You can not downgrade to Windows XP from a newer version of Windows or migrate" & @CR & "from a 64bit OS to a 32bit OS with this tool)", 10, 365, 470, 40, $SS_CENTER) $Question = GUICtrlCreateButton("?", 460, 0, 20, 20) GUICtrlSetBkColor(-1, 0x00f700) GUISetBkColor(0xb2ccff, $RestoreGUI) GUISetState(@SW_SHOW, $RestoreGUI) EndFunc ;==>_RestoreGUI Func _CreateExecute() $TargetPath = GUICtrlRead($Target) $CustomerArg = GUICtrlRead($CustName) $RepairArg = GUICtrlRead($RepairNumber) $TechArg = GUICtrlRead($Tech) If $TargetPath <> "" And $CustomerArg <> "" And $RepairArg <> "" And $TechArg <> "" Then If StringRight($TargetPath, 1) == "\" Then $TargetPath = StringTrimRight($TargetPath, 1) $TargetPath &= StringUpper("\" & $CustomerArg & "-" & $RepairArg & "-" & $TechArg & "-" & @MON & @MDAY & StringMid(@YEAR, 3, 2)) $LogFile = $TargetPath & ".txt" $OverwriteArg = " " If GUICtrlRead($Overwrite) == 1 Then $OverwriteArg = " /o" $NoCompressArg = " " If GUICtrlRead($NoCompress) == 1 Then $NoCompressArg = " /nocompress " $TimesToRetryArg = 3 If GUICtrlRead($TimesToRetry) <> "" Then $TimesToRetryArg = GUICtrlRead($TimesToRetry) $SecondsToWaitArg = 1 If GUICtrlRead($SecondsToWait) <> "" Then $SecondsToWaitArg = GUICtrlRead($SecondsToWait) $OfflineArg = "" $OfflinePathArg = GUICtrlRead($OfflinePath) If GUICtrlRead($Offline) == 1 And $OfflinePathArg <> "" Then $OfflineArg = "/offlineWinDir:" & Chr(34) & $OfflinePathArg & Chr(34) GUICtrlDelete($CreateGoButton) If $XPMode == False Then _Extract($XPMode) ShellExecuteWait(@TempDir & "\USMT\scanstate.exe", Chr(34) & $TargetPath & Chr(34) & " /localonly /vsc /efs:decryptcopy" & $OverwriteArg & $NoCompressArg & $OfflineArg & " /r:" & $TimesToRetryArg & " /w:" & $SecondsToWaitArg & " /L:" & Chr(34) & $LogFile & Chr(34) & " /v:13 /c /all /i:" & @TempDir & "\USMT\MigApp.xml /i:" & @TempDir & "\USMT\MigDocs.xml /i:" & @TempDir & "\USMT\MigUser.xml", @TempDir) Else _Extract($XPMode) ShellExecuteWait(@TempDir & "\USMT\scanstate.exe", Chr(34) & $TargetPath & Chr(34) & " /targetxp /localonly /efs:decryptcopy" & $OverwriteArg & $NoCompressArg & " /r:" & $TimesToRetryArg & " /w:" & $SecondsToWaitArg & " /L:" & Chr(34) & $LogFile & Chr(34) & " /v:13 /c /all /i:" & @TempDir & "\USMT\MigApp.xml /i:" & @TempDir & "\USMT\MigSys.xml /i:" & @TempDir & "\USMT\MigUser.xml", @TempDir) EndIf Do Sleep(1000) Until Not ProcessExists("scanstate.exe") MsgBox(0, "Done", "Finished backing up.") Exit EndIf EndFunc ;==>_CreateExecute Func _RestoreExecute() $TargetPath = GUICtrlRead($Target) If $TargetPath <> "" Then $TargetBreak = StringSplit($TargetPath, "\") $Last = $TargetBreak[0] $LogFile = "c:\" & $TargetBreak[$Last] & ".txt" $TimesToRetryArg = 3 If GUICtrlRead($TimesToRetry) <> "" Then $TimesToRetryArg = GUICtrlRead($TimesToRetry) $SecondsToWaitArg = 1 If GUICtrlRead($SecondsToWait) <> "" Then $SecondsToWaitArg = GUICtrlRead($SecondsToWait) $NoCompressArg = "" $FileCount = DirGetSize($TargetPath, 1) If $FileCount[1] > 1 Then $NoCompressArg = "/nocompress " GUICtrlDelete($RestoreGoButton) If @OSVersion == "WIN_XP" Then $XPMode = True _Extract($XPMode) ShellExecuteWait(@TempDir & "\USMT\loadstate.exe", Chr(34) & $TargetPath & Chr(34) & " /lac /lae " & $NoCompressArg & "/r:" & $TimesToRetryArg & " /w:" & $SecondsToWaitArg & " /L:" & Chr(34) & $LogFile & Chr(34) & " /v:13 /c /all /i:" & @TempDir & "\USMT\MigApp.xml /i:" & @TempDir & "\USMT\MigSys.xml /i:" & @TempDir & "\USMT\MigUser.xml", @TempDir) Else _Extract($XPMode) ShellExecuteWait(@TempDir & "\USMT\loadstate.exe", Chr(34) & $TargetPath & Chr(34) & " /lac /lae " & $NoCompressArg & "/r:" & $TimesToRetryArg & " /w:" & $SecondsToWaitArg & " /L:" & Chr(34) & $LogFile & Chr(34) & " /v:13 /c /all /i:" & @TempDir & "\USMT\MigApp.xml /i:" & @TempDir & "\USMT\MigDocs.xml /i:" & @TempDir & "\USMT\MigUser.xml", @TempDir) EndIf Do Sleep(1000) Until Not ProcessExists("loadstate.exe") MsgBox(0, "Done", "Finished restoring.") Exit EndIf EndFunc ;==>_RestoreExecute Func _Extract($XPMode) FileInstall("7z.exe", @TempDir & "\7z.exe", 1) FileInstall("7z.dll", @TempDir & "\7z.dll", 1) DirRemove(@TempDir & "\USMT", 1) DirCreate(@TempDir & "\USMT") If $XPMode == True Then If @OSArch == "X86" Then FileInstall("USMT301x86.7z", @TempDir & "\USMT301x86.7z", 1) ShellExecuteWait(@TempDir & "\7z.exe", "e " & @TempDir & "\USMT301x86.7z", @TempDir & "\USMT") Else FileInstall("USMT301x64.7z", @TempDir & "\USMT301x64.7z", 1) ShellExecuteWait(@TempDir & "\7z.exe", "e " & @TempDir & "\USMT301x64.7z", @TempDir & "\USMT") EndIf Else If @OSArch == "X86" Then FileInstall("USMT401x86.7z", @TempDir & "\USMT401x86.7z", 1) ShellExecuteWait(@TempDir & "\7z.exe", "e " & @TempDir & "\USMT401x86.7z", @TempDir & "\USMT") Else FileInstall("USMT401x64.7z", @TempDir & "\USMT401x64.7z", 1) ShellExecuteWait(@TempDir & "\7z.exe", "e " & @TempDir & "\USMT401x64.7z", @TempDir & "\USMT") EndIf EndIf Sleep(500) EndFunc ;==>_Extract Func _Question() $QuestionGUI = GUICreate("USMT Front End - MaxImuM AdVaNtAgE SofTWarE © 2011", 480, 400, @DesktopWidth / 2 - 240, @DesktopHeight / 2 - 200) GUICtrlCreateLabel("Build Date 01/26/2011", 355, 10, 460, 20) GUICtrlCreateLabel("This application is a front end for Microsoft's User State Migration Tool, and contains all USMT files. The User State Migration Tool is a Microsoft command line utility to copy user files and settings from one computer to another USMT transfers user accounts, E-mai messages, settings, and contacts, photos, music, videos, Windows settings, program data files and settings, and Internet settings." & @CR & @CR & "This tool is designed to work with USMT 3.01 and USMT 4.01, the key difference between the versions being which versions of Windows they restore to. USMT 3.01 is able to migrate Windows 2000 - Vista to Windows XP and Windows Vista. USMT 4.01 is able to migrate Windows XP - 7 to Vista and 7. USMT 4.01 is also able to migrate an " & Chr(34) & "offline" & Chr(34) & " drive, meaning a drive that is not the one being booted from." & @CR & @CR & "The options used in this front end have been customized for backing up only local user account data, so do not use this tool as-is in a network environment where capturing domain user data is important. The XML files have also not been modified except to not migrate Start Menu files, so this tool may not be suitable if you need to include additional application settings or data than the default items for the respective versions of USMT. Please refer to the various Microsoft Technet articles concerning USMT for details." & @CR & @CR & "The specific command lines used with all front end options set as default are as follows:" & @CR & @CR & "scanstate.exe $TargetPath /localonly /vsc /efs:decryptcopy /o /nocompress /r:3 /w:1 /L:$LogFile /v:13 /c /all /i:MigApp.xml /i:MigUser.xml /i:MigDocs.xml (or /i:MigSys.xml)" & @CR & @CR & "loadstate.exe $TargetPath /lac /lae /r:3 /w:1 /L:$LogFile /v:13 /c /all /i:MigApp.xml /i:MigUser.xml /i:MigDocs.xml (or /i:MigSys.xml)", 10, 40, 460, 360) GUISetBkColor(0xb2ccff, $QuestionGUI) GUISetState(@SW_SHOW, $QuestionGUI) Do $MSG = GUIGetMsg() If $MSG == $GUI_EVENT_CLOSE Then GUIDelete($QuestionGUI) ExitLoop EndIf Until 1 = 2 EndFunc ;==>_Question
Enjoy!
Ian
Edited by llewxam, 31 January 2011 - 07:49 PM.





