
Neo2102
Members-
Posts
3 -
Joined
-
Last visited
Neo2102's Achievements

Seeker (1/7)
0
Reputation
-
Hello, I try to do my first AutoIT application (User Backup Tool) Everyting work great exept when I click on the button Backup ($Pic3) When I click on the button "Backup" My idea is the 2 button Exit ($Pic2) & Backup ($Pic3) is removed and replace by a progressBar The problem is when I click on the Backup button I see the progressbar is present but I don't know why the Button Exit & Backup stay on GUI on the progressbar.... Here it's a screenshot of the application befor clicking on Backup (Look great) And this screenshot it's after I click on Backup ... As you can see the fuck*** button are present on GUI and on the ProgressBAR Here the code: It's my first autoit script so maybe it's not coded perfectly but it's work exept this problem with the button... WHo can help me ? #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> LOCAL $objObject, $SINK_OnObjectReady, $objAsyncContext, $i, $Pic2, $Pic3, $CancelBut, $UserProfileSize $strComputer = "." $objWMIServices = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") $sink = ObjCreate("WbemScripting.SWbemSink") ObjEvent($sink,"SINK_") $objWMIServices.ExecNotificationQueryAsync ($sink, "SELECT * FROM __InstanceOperationEvent WITHIN 5 WHERE " & "TargetInstance ISA 'Win32_LogicalDisk'") $UserProfileSize=DirGetSize("C:\Users\"&@UserName) $aArray = DriveGetDrive("REMOVABLE") If @Error Then #Region ### START Koda GUI section ### Form= $Main = GUICreate(".: DG CNECT - User Backup Tool :.", 653, 543, 192, 124) GUISetBkColor(0x4191EB) $Pic1 = GUICtrlCreatePic("\\s-infso-landesk\packages\BackupTool\Header.jpg", 0, 0, 652, 100) $Group1 = GUICtrlCreateGroup("INFOS", 8, 128, 305, 137) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label6 = GUICtrlCreateLabel("Welcome :", 16, 160, 74, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label7 = GUICtrlCreateLabel("Computer name :", 16, 192, 117, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label8 = GUICtrlCreateLabel("Last backup :", 16, 224, 92, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label11 = GUICtrlCreateLabel(""&@ComputerName, 140, 192, 164, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label12 = GUICtrlCreateLabel(""&@UserName, 100, 160, 132, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label20 = GUICtrlCreateLabel("Last Backup Value", 112, 224, 119, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("", 8, 264, 305, 161) $Label1 = GUICtrlCreateLabel("This tool will backup the following :", 16, 280, 238, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label2 = GUICtrlCreateLabel("- All your local documents", 16, 312, 164, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label3 = GUICtrlCreateLabel("- Your Internet Explorer Favorites", 16, 336, 215, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label4 = GUICtrlCreateLabel("- Your Desktop", 16, 384, 97, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label5 = GUICtrlCreateLabel("- Your Mozilla Firefox Favorites", 16, 360, 195, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label9 = GUICtrlCreateLabel("Please save and close all your documents and applications before continue.", 48, 448, 553, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Pic2 = GUICtrlCreateButton("Exit", 224, 488, 75, 40, $BS_ICON) GUICtrlSetImage(-1, "\\s-infso-landesk\packages\BackupTool\Bouton-Exit.ico", -1) GUICtrlCreateGroup("", -99, -99, 1, 1) $Pic3 = 9999 $CancelBut = 9999 $Label10 = GUICtrlCreateLabel("Current date and time :", 360, 104, 153, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label13 = GUICtrlCreateLabel(""&@MDAY&"/"&@MON&"/"&@YEAR&" | "&@HOUR&":"&@MIN, 515, 105, 125, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Group3 = GUICtrlCreateGroup("USB Key Infos", 336, 128, 297, 297) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label14 = GUICtrlCreateLabel("NO USB Device found ! Please Insert USB", 344, 168, 285, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Label18 = GUICtrlCreateLabel("", 448, 208, 141, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Label19 = GUICtrlCreateLabel("", 496, 248, 109, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Label22 = GUICtrlCreateLabel("", 472, 288, 109, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Label24 = GUICtrlCreateLabel("", 432, 392, 100, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) $UserProfileSize=DirGetSize(@UserProfileDir) #EndRegion ### END Koda GUI section ### Else For $i = 1 To $aArray[0] If DriveSpaceTotal(StringUpper($aArray[$i])) < "16000" And DriveSpaceTotal(StringUpper($aArray[$i])) > "0" Then $Freespace = DriveSpaceFree($aArray[$i]) $Totalspace = DriveSpaceTotal($aArray[$i]) $Main = GUICreate(".: DG CNECT - User Backup Tool :.", 653, 543, 192, 124) GUISetBkColor(0x4191EB) $Pic1 = GUICtrlCreatePic("\\s-infso-landesk\packages\BackupTool\Header.jpg", 0, 0, 652, 100) $Group1 = GUICtrlCreateGroup("INFOS", 8, 128, 305, 137) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) If FormatFileSize($UserProfileSize) > FormatFileSize($Freespace) Then $Label24 = GUICtrlCreateLabel("No USB Free Space Available", 432, 392, 200, 20) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Pic3 = GUICtrlCreateButton("Backup", 312, 488, 75, 40, $BS_ICON) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetImage(-1, "\\s-infso-landesk\packages\BackupTool\Bouton-Backup.ico", -1) GUICtrlCreateGroup("", -99, -99, 1, 1) Else $Label24 = GUICtrlCreateLabel("USB Free Space OK", 432, 392, 200, 20) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Pic3 = GUICtrlCreateButton("Backup", 312, 488, 75, 40, $BS_ICON) GUICtrlSetState(-1, $GUI_ENABLE) GUICtrlSetImage(-1, "\\s-infso-landesk\packages\BackupTool\Bouton-Backup.ico", -1) GUICtrlCreateGroup("", -99, -99, 1, 1) EndIf $Label6 = GUICtrlCreateLabel("Welcome :", 16, 160, 74, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label7 = GUICtrlCreateLabel("Computer name :", 16, 192, 117, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label8 = GUICtrlCreateLabel("Last backup :", 16, 224, 92, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label11 = GUICtrlCreateLabel(""&@ComputerName, 140, 192, 164, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label12 = GUICtrlCreateLabel(""&@UserName, 100, 160, 132, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label20 = GUICtrlCreateLabel("Last Backup Value", 112, 224, 119, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("", 8, 264, 305, 161) $Label1 = GUICtrlCreateLabel("This tool will backup the following :", 16, 280, 238, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label2 = GUICtrlCreateLabel("- All your local documents", 16, 312, 164, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label3 = GUICtrlCreateLabel("- Your Internet Explorer Favorites", 16, 336, 215, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label4 = GUICtrlCreateLabel("- Your Desktop", 16, 384, 97, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label16 = GUICtrlCreateLabel("Total USB Free Space: ", 344, 248, 151, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label5 = GUICtrlCreateLabel("- Your Mozilla Firefox Favorites", 16, 360, 195, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label9 = GUICtrlCreateLabel("Please save and close all your documents and applications before continue.", 48, 448, 553, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Pic2 = GUICtrlCreateButton("Exit", 224, 488, 75, 40, $BS_ICON) GUICtrlSetImage(-1, "\\s-infso-landesk\packages\BackupTool\Bouton-Exit.ico", -1) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label10 = GUICtrlCreateLabel("Current date and time :", 360, 104, 153, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label13 = GUICtrlCreateLabel(""&@MDAY&"/"&@MON&"/"&@YEAR&" | "&@HOUR&":"&@MIN, 515, 105, 125, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Group3 = GUICtrlCreateGroup("USB Key Infos", 336, 128, 297, 297) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label14 = GUICtrlCreateLabel("USB Device found on " & $aArray[$i] & " drive", 344, 168, 285, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Label15 = GUICtrlCreateLabel("Total USB Size: ", 344, 208, 107, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label18 = GUICtrlCreateLabel(FormatFileSize($Totalspace), 448, 208, 141, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Label19 = GUICtrlCreateLabel(FormatFileSize($Freespace), 496, 248, 109, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Label21 = GUICtrlCreateLabel("Total Backup Size: ", 344, 288, 127, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label22 = GUICtrlCreateLabel(FormatFileSize($UserProfileSize), 472, 288, 109, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Label23 = GUICtrlCreateLabel("Data Check:", 344, 392, 85, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) $CancelBut = 9999 $UserProfileSize=DirGetSize(@UserProfileDir) #EndRegion ### END Koda GUI section ### EndIf Next EndIf Func SINK_OnObjectReady($objObject, $objAsyncContext) If $objObject.TargetInstance.DriveType = 2 Then Select Case $objObject.Path_.Class()="__InstanceCreationEvent" $UserProfileSize=DirGetSize(@UserProfileDir) $Label14 = GUICtrlCreateLabel("USB Device found on " & $objObject.TargetInstance.DeviceId & " drive", 344, 168, 285, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Freespace = DriveSpaceFree($objObject.TargetInstance.DeviceId) $Totalspace = DriveSpaceTotal($objObject.TargetInstance.DeviceId) If FormatFileSize($UserProfileSize) < FormatFileSize($Freespace) Then $Label24 = GUICtrlCreateLabel("No USB Free Space Available", 432, 392, 200, 20) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Pic3 = GUICtrlCreateButton("Backup", 312, 488, 75, 40, $BS_ICON) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetImage(-1, "\\s-infso-landesk\packages\BackupTool\Bouton-Backup.ico", -1) GUICtrlCreateGroup("", -99, -99, 1, 1) Else $Pic3 = GUICtrlCreateButton("Backup", 312, 488, 75, 40, $BS_ICON) GUICtrlSetImage(-1, "\\s-infso-landesk\packages\BackupTool\Bouton-Backup.ico", -1) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label24 = GUICtrlCreateLabel("USB Free Space OK", 432, 392, 200, 20) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) EndIf $Label19 = GUICtrlCreateLabel(FormatFileSize($Freespace), 496, 248, 109, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Label18 = GUICtrlCreateLabel(FormatFileSize($Totalspace), 448, 208, 141, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Label15 = GUICtrlCreateLabel("Total USB Size: ", 344, 208, 107, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label16 = GUICtrlCreateLabel("Total USB Free Space: ", 344, 248, 151, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label21 = GUICtrlCreateLabel("Total Backup Size: ", 344, 288, 127, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label22 = GUICtrlCreateLabel(FormatFileSize($UserProfileSize), 472, 288, 109, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Label23 = GUICtrlCreateLabel("Data Check:", 344, 392, 85, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) ;$Pic3 = GUICtrlCreateButton("Backup", 312, 488, 75, 40, $BS_ICON) ;GUICtrlSetImage(-1, "\\s-infso-landesk\packages\BackupTool\Bouton-Backup.ico", -1) ;GUICtrlCreateGroup("", -99, -99, 1, 1) Case $objObject.Path_.Class()="__InstanceDeletionEvent" #Region ### START Koda GUI section ### Form= $UserProfileSize=DirGetSize(@UserProfileDir) ;$Main = GUICreate(".: DG CNECT - User Backup Tool :.", 653, 543, 192, 124) ;GUISetBkColor(0x4191EB) $Pic1 = GUICtrlCreatePic("\\s-infso-landesk\packages\BackupTool\Header.jpg", 0, 0, 652, 100) $Group1 = GUICtrlCreateGroup("INFOS", 8, 128, 305, 137) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label6 = GUICtrlCreateLabel("Welcome :", 16, 160, 74, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label7 = GUICtrlCreateLabel("Computer name :", 16, 192, 117, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label8 = GUICtrlCreateLabel("Last backup :", 16, 224, 92, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label11 = GUICtrlCreateLabel(""&@ComputerName, 140, 192, 164, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label12 = GUICtrlCreateLabel(""&@UserName, 100, 160, 132, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label15 = GUICtrlCreateLabel("", 344, 208, 107, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label16 = GUICtrlCreateLabel("", 344, 248, 151, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label21 = GUICtrlCreateLabel("", 344, 288, 127, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label20 = GUICtrlCreateLabel("Last Backup Value", 112, 224, 119, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("", 8, 264, 305, 161) $Label1 = GUICtrlCreateLabel("This tool will backup the following :", 16, 280, 238, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label2 = GUICtrlCreateLabel("- All your local documents", 16, 312, 164, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label3 = GUICtrlCreateLabel("- Your Internet Explorer Favorites", 16, 336, 215, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label4 = GUICtrlCreateLabel("- Your Desktop", 16, 384, 97, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label5 = GUICtrlCreateLabel("- Your Mozilla Firefox Favorites", 16, 360, 195, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label9 = GUICtrlCreateLabel("Please save and close all your documents and applications before continue.", 48, 448, 553, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Pic2 = GUICtrlCreateButton("Exit", 224, 488, 75, 40, $BS_ICON) GUICtrlSetImage(-1, "\\s-infso-landesk\packages\BackupTool\Bouton-Exit.ico", -1) GUICtrlCreateGroup("", -99, -99, 1, 1) $Pic3 = GUICtrlCreateLabel("", 312, 488, 75, 40) ;GUICtrlCreateGroup("", -99, -99, 1, 1) ;$Pic3 = 12345 ;GUICtrlCreateLabel("", 312, 488, 75, 40, $BS_ICON) ;GUICtrlSetImage(-1, "\\s-infso-landesk\packages\BackupTool\Bouton-Backup.ico", -1) ;GUICtrlCreateGroup("", -99, -99, 1, 1) $Label10 = GUICtrlCreateLabel("Current date and time :", 360, 104, 153, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label13 = GUICtrlCreateLabel(""&@MDAY&"/"&@MON&"/"&@YEAR&" | "&@HOUR&":"&@MIN, 515, 105, 125, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Group3 = GUICtrlCreateGroup("USB Key Infos", 336, 128, 297, 297) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label14 = GUICtrlCreateLabel("NO USB Device found ! Please Insert USB", 344, 168, 285, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Label18 = GUICtrlCreateLabel("", 448, 208, 141, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Label19 = GUICtrlCreateLabel("", 496, 248, 109, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Label22 = GUICtrlCreateLabel("", 472, 288, 109, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Label23 = GUICtrlCreateLabel("", 344, 392, 85, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label24 = GUICtrlCreateLabel("", 432, 392, 200, 20) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Label24 = GUICtrlCreateLabel("", 432, 392, 100, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) GUICtrlCreateGroup("", -99, -99, 1, 1) ;GUISetState(@SW_SHOW) ;$Pic3 = 12345 ;GUICtrlCreateLabel("", 312, 488, 75, 40, $BS_ICON) #EndRegion ### END Koda GUI section ### EndSelect EndIf EndFunc Func FormatFileSize($iSizeInBytes) Local $iSize, $i $iSize = $iSizeInBytes $i = 0 While $iSize >= 1024 ;split value, you can set lower number like 900 for earlier switch (0.98 MB) $iSize /= 1024 ;this must be always 1024 $i += 1 WEnd $iSize = Round($iSize, 2) & " "; enter how many decimals you want, here it's '1' Switch $i Case 1 $iSize = $iSize & "G" Case 2 $iSize = $iSize & "M" Case 3 $iSize = $iSize & "G" Case 4 $iSize = $iSize & "T" EndSwitch Return $iSize & "B" EndFunc While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Pic2 ExitLoop Case $msg = $CancelBut ExitLoop Case $msg = $Pic3 $Progress1 = GUICtrlCreateProgress(40, 496, 495, 33) $Pic2 = GUICtrlCreateLabel("", 224, 488, 75, 40, $BS_ICON) $Pic3 = GUICtrlCreateLabel("", 312, 488, 75, 40, $BS_ICON) $Pic1 = GUICtrlCreatePic("\\s-infso-landesk\packages\BackupTool\Header.jpg", 0, 0, 652, 100) $Group1 = GUICtrlCreateGroup("INFOS", 8, 128, 305, 137) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label6 = GUICtrlCreateLabel("Welcome :", 16, 160, 74, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label7 = GUICtrlCreateLabel("Computer name :", 16, 192, 117, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label8 = GUICtrlCreateLabel("Last backup :", 16, 224, 92, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label11 = GUICtrlCreateLabel(""&@ComputerName, 140, 192, 164, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label12 = GUICtrlCreateLabel(""&@UserName, 100, 160, 132, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label20 = GUICtrlCreateLabel("Last Backup Value", 112, 224, 119, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("", 8, 264, 305, 161) $Label1 = GUICtrlCreateLabel("This tool will backup the following :", 16, 280, 238, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label2 = GUICtrlCreateLabel("- All your local documents", 16, 312, 164, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label3 = GUICtrlCreateLabel("- Your Internet Explorer Favorites", 16, 336, 215, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label4 = GUICtrlCreateLabel("- Your Desktop", 16, 384, 97, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label16 = GUICtrlCreateLabel("Total USB Free Space: ", 344, 248, 151, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label5 = GUICtrlCreateLabel("- Your Mozilla Firefox Favorites", 16, 360, 195, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label9 = GUICtrlCreateLabel("Backup in Progress ! Please Wait ... Do NOT Remove USB Key", 48, 448, 553, 20) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $CancelBut = GUICtrlCreateButton("CANCEL", 560, 496, 73, 33) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFC0000) $Label10 = GUICtrlCreateLabel("Current date and time :", 360, 104, 153, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label13 = GUICtrlCreateLabel(""&@MDAY&"/"&@MON&"/"&@YEAR&" | "&@HOUR&":"&@MIN, 515, 105, 125, 20) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Group3 = GUICtrlCreateGroup("USB Key Infos", 336, 128, 297, 297) GUICtrlSetFont(-1, 10, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFF00) $Label15 = GUICtrlCreateLabel("Total USB Size: ", 344, 208, 107, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label18 = GUICtrlCreateLabel(FormatFileSize($Totalspace), 448, 208, 141, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Label19 = GUICtrlCreateLabel(FormatFileSize($Freespace), 496, 248, 109, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Label21 = GUICtrlCreateLabel("Total Backup Size: ", 344, 288, 127, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label22 = GUICtrlCreateLabel(FormatFileSize($UserProfileSize), 472, 288, 109, 18) GUICtrlSetFont(-1, 9, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) $Label23 = GUICtrlCreateLabel("Data Check:", 344, 392, 85, 18) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0xFFFFFF) $Label24 = GUICtrlCreateLabel("USB Free Space OK", 432, 392, 200, 20) GUICtrlSetFont(-1, 9, 800, 0, "Verdana") GUICtrlSetColor(-1, 0x49fc77) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### EndSelect WEnd
-
Windows User files back up and restore
Neo2102 replied to BrewManNH's topic in AutoIt Example Scripts
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 -
Monitor for a USB drive connection
Neo2102 replied to gingerbloke's topic in AutoIt General Help and Support
Hello, It's possible to have a copy of your source code please ? I need a script for front end user who need to backup profile on a USB drive (Full or Incremental) Thanks