Что нового

Модифицировать скрипт для подсчета размера папок, выделенных чекбоксами

Hulk777

Новичок
Сообщения
72
Репутация
1
Версия AutoIt: 3.3.12.0

Имеется такой код:

Код:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <GuiComboBox.au3>
#include <File.au3>
$hGUI = GUICreate("Создание флешки", 440, 490, -1, -1)
$iColor=0xDADADA
GUISetBkColor($iColor)
$font = "Arial"

;Кнопки
$Button1 = GUICtrlCreateButton("Подготовка носителя", 20, 30, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button2 = GUICtrlCreateButton("Установка загрузчика", 220, 30, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

;Группировка
GUICtrlCreateGroup("Подготовка флешки",10,10,420,60,-1,-1)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
GUICtrlSetColor(-1, 0x0000CD) ; Замена цвета в группе
GUICtrlSetFont(-1, 12, 400, 0, $font) ; Крупный шрифт
GUICtrlSetFont(-1, 12, 700, 0, $font) ; Жирный шрифт

$Checkbox1 = GUICtrlCreateCheckbox("Базовые файлы", 20, 100, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Поддержка UEFI", 20, 120, 100, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Windows 7x86", 20, 140, 90, 17)
$Checkbox4 = GUICtrlCreateCheckbox("Windows 7x64", 20, 160, 90, 17)
$Checkbox5 = GUICtrlCreateCheckbox("Windows 8.1x86", 20, 180, 100, 17)
$Checkbox6 = GUICtrlCreateCheckbox("Windows 8.1x64", 20, 200, 100, 17)
$Checkbox7 = GUICtrlCreateCheckbox("Windows 10x86", 20, 220, 95, 17)
$Checkbox8 = GUICtrlCreateCheckbox("Windows 10x64", 20, 240, 95, 17)
$Checkbox9 = GUICtrlCreateCheckbox("Windows XPx86 (Ver 1)", 20, 260, 130, 17)
$Checkbox10  = GUICtrlCreateCheckbox("Windows XPx86 (Ver 2)", 20, 280, 130, 17)
$Checkbox11  = GUICtrlCreateCheckbox("Linux Mint 15", 220, 100, 80, 17)
$Checkbox12  = GUICtrlCreateCheckbox("Boot USB Sergey Strelec", 220, 120, 140, 17)
$Checkbox13  = GUICtrlCreateCheckbox("Windows Live 2k10", 220, 140, 110, 17)
$Checkbox14  = GUICtrlCreateCheckbox("MSDART & Recovery", 220, 160, 120, 17)
$Checkbox15  = GUICtrlCreateCheckbox("AntiWinBlock", 220, 180, 80, 17)
$Checkbox16  = GUICtrlCreateCheckbox("Hirens Boot 10.6", 220, 200, 100, 17)
$Checkbox17  = GUICtrlCreateCheckbox("Диагност. утилиты", 220, 220, 120, 17)
$Checkbox18  = GUICtrlCreateCheckbox("Сборник Acronis", 220, 240, 100, 17)
$Checkbox19  = GUICtrlCreateCheckbox("Папка с драйверами", 220, 260, 125, 17)
$Checkbox20  = GUICtrlCreateCheckbox("Папка с софтом", 220, 280, 100, 17)
$Checkbox21  = GUICtrlCreateCheckbox("Сформирофать bcd ", 20, 300, 150, 17)
$Checkbox22  = GUICtrlCreateCheckbox("Редактировать menu.lst ", 220, 300, 150, 17)

;Группировка
GUICtrlCreateGroup("Формирование набора",10,70,420,415,-1,-1)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
GUICtrlSetColor(-1, 0x0000CD) ; Замена цвета в группе
GUICtrlSetFont(-1, 12, 400, 0, $font) ; Крупный шрифт
GUICtrlSetFont(-1, 12, 700, 0, $font) ; Жирный шрифт

$Button3 = GUICtrlCreateButton("По умолчанию", 20, 390, 400, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button4 = GUICtrlCreateButton("Сбросить", 20, 420, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button5 = GUICtrlCreateButton("Применить", 220, 420, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button6 = GUICtrlCreateButton("Выйти из программы", 20, 450, 400, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button7 = GUICtrlCreateButton("Обновить", 350, 330, 70, 25)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button8 = GUICtrlCreateButton("Обновить", 350, 360, 70, 25)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Combo1 = GUICtrlCreateCombo("", 20, 330, 325, 30, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE, $CBS_AUTOHSCROLL))

$Combo2 = GUICtrlCreateCombo("", 20, 360, 325, 30, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE, $CBS_AUTOHSCROLL))

GUICtrlCreateLabel('(587 МБ)', 120,102,70,12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\efi") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 125, 122, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win7x86") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 110, 142, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win7x64") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 110, 162, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win8x86") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 120, 182, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win8x64") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 120, 202, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win10x86") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 115, 222, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win10x64") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 115, 242, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\winXPx86\XPpSP31") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 155, 262, 60, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\winXPx86\XPpSP3") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 155, 282, 60, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\mint") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 305, 102, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\sstr") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 360, 122, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\2k10") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 335, 142, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\erdc") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 340, 162, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\awbl") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 305, 182, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\hbcd") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 322, 202, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\util") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 342, 222, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\acrs") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 325, 242, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\2drv") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 345, 262, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\1sft") / 1048576, 2)
$Label = GUICtrlCreatelabel("(" & $iSize & " Мб)", 325, 282, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case -3
            Exit
        Case $Button1
            Run('Utilites\paragon.exe')           
        Case $Button2
            Run('Utilites\grub\grubinst_gui.exe')
        Case $Button3
            GUICtrlSetState($Checkbox1, $GUI_CHECKED)
            GUICtrlSetState($Checkbox2, $GUI_CHECKED)
            GUICtrlSetState($Checkbox3, $GUI_CHECKED)
            GUICtrlSetState($Checkbox4, $GUI_CHECKED)
            GUICtrlSetState($Checkbox5, $GUI_CHECKED)
            GUICtrlSetState($Checkbox6, $GUI_CHECKED)
            GUICtrlSetState($Checkbox7, $GUI_CHECKED)
            GUICtrlSetState($Checkbox8, $GUI_CHECKED)
            GUICtrlSetState($Checkbox9, $GUI_CHECKED)
            GUICtrlSetState($Checkbox10, $GUI_CHECKED)
            GUICtrlSetState($Checkbox11, $GUI_CHECKED)
            GUICtrlSetState($Checkbox12, $GUI_CHECKED)
            GUICtrlSetState($Checkbox13, $GUI_CHECKED)
            GUICtrlSetState($Checkbox14, $GUI_CHECKED)
            GUICtrlSetState($Checkbox15, $GUI_CHECKED)
            GUICtrlSetState($Checkbox16, $GUI_CHECKED)
            GUICtrlSetState($Checkbox17, $GUI_CHECKED)
            GUICtrlSetState($Checkbox18, $GUI_CHECKED)
            GUICtrlSetState($Checkbox19, $GUI_CHECKED)
            GUICtrlSetState($Checkbox20, $GUI_CHECKED)
            GUICtrlSetState($Checkbox21, $GUI_CHECKED)
            GUICtrlSetState($Checkbox22, $GUI_CHECKED)
        Case $Button4
            GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox3, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox4, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox5, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox6, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox7, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox8, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox9, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox10, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox11, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox12, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox13, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox14, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox15, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox16, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox17, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox18, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox19, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox20, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox21, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox22, $GUI_UNCHECKED)    
        Case $Button5
            if GUICtrlRead($Checkbox1) = 1 Then RunWait('utilites\scripts\copybase.cmd')
            if GUICtrlRead($Checkbox2) = 1 Then RunWait('utilites\scripts\copyefi.cmd')
            if GUICtrlRead($Checkbox3) = 1 Then RunWait('utilites\scripts\win7x86.cmd')
            if GUICtrlRead($Checkbox4) = 1 Then RunWait('utilites\scripts\win7x64.cmd')
            if GUICtrlRead($Checkbox5) = 1 Then RunWait('utilites\scripts\win81x86.cmd')
            if GUICtrlRead($Checkbox6) = 1 Then RunWait('utilites\scripts\win81x64.cmd')
            if GUICtrlRead($Checkbox7) = 1 Then RunWait('utilites\scripts\win10x86.cmd')
            if GUICtrlRead($Checkbox8) = 1 Then RunWait('utilites\scripts\win10x64.cmd')
            if GUICtrlRead($Checkbox9) = 1 Then RunWait('utilites\scripts\winXPx86(V1).cmd')
            if GUICtrlRead($Checkbox10) = 1 Then RunWait('utilites\scripts\winXPx86(V2).cmd')
            if GUICtrlRead($Checkbox11) = 1 Then RunWait('utilites\scripts\copymint.cmd')
            if GUICtrlRead($Checkbox12) = 1 Then RunWait('utilites\scripts\copysstr.cmd')
            if GUICtrlRead($Checkbox13) = 1 Then RunWait('utilites\scripts\copy2K10.cmd')                   
            if GUICtrlRead($Checkbox14) = 1 Then RunWait('utilites\scripts\copyerdc.cmd')
            if GUICtrlRead($Checkbox15) = 1 Then RunWait('utilites\scripts\copyawbl.cmd')
            if GUICtrlRead($Checkbox16) = 1 Then RunWait('utilites\scripts\copyhbcd.cmd')
            if GUICtrlRead($Checkbox17) = 1 Then RunWait('utilites\scripts\copyutil.cmd')
            if GUICtrlRead($Checkbox18) = 1 Then RunWait('utilites\scripts\copyacrs.cmd')
            if GUICtrlRead($Checkbox19) = 1 Then RunWait('utilites\scripts\copy2drv.cmd')
            if GUICtrlRead($Checkbox20) = 1 Then RunWait('utilites\scripts\copy1sft.cmd')
            if GUICtrlRead($Checkbox21) = 1 Then RunWait('utilites\scripts\menuedit.cmd')
            if GUICtrlRead($Checkbox22) = 1 Then RunWait('utilites\scripts\menulst.cmd')
        Case $Button6
                 Exit
        Case $Button7
            _flesh_search()
    EndSwitch
WEnd

Func _flesh_search()
    $objWMIService = ObjGet("winmgmts:\\.\root\cimv2")
    $colDiskDrives = $objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive")
    For $objDrive In $colDiskDrives
        ConsoleWrite("Physical Disk: " & $objDrive.Caption & @LF)
        $strDeviceID = StringReplace($objDrive.DeviceID, "\", "\\")
        $colPartitions = $objWMIService.ExecQuery('ASSOCIATORS OF {Win32_DiskDrive.DeviceID="' & $strDeviceID & '"} WHERE AssocClass = Win32_DiskDriveToDiskPartition')
        For $objPartition In $colPartitions
            ;        ConsoleWrite(@TAB & "Disk Partition: " & $objPartition.DeviceID & @LF)
            $colLogicalDisks = $objWMIService.ExecQuery('ASSOCIATORS OF {Win32_DiskPartition.DeviceID="' & $objPartition.DeviceID & '"} WHERE AssocClass = Win32_LogicalDiskToPartition')
            For $objLogicalDisk In $colLogicalDisks
                If DriveGetType($objLogicalDisk.DeviceID) = "Removable" Then
                    ConsoleWrite(@TAB & "Logical Disk: " & $objLogicalDisk.DeviceID & @LF)
                    ;узнаём объём флехи
                    $TotalMemL = DriveSpaceTotal($objLogicalDisk.DeviceID)
                    $TotalMem = Round($TotalMemL)
                    ;узнаём файловую систему
                    $FileSystem = DriveGetFileSystem($objLogicalDisk.DeviceID)
                    ;узнаём свободное места на флешке флешке
                    $FreeMemL = DriveSpaceFree($objLogicalDisk.DeviceID)
                    $FreeMem = Round($FreeMemL)
                    $DriveM = StringReplace($objDrive.Caption, " USB Device", "")
                    _GUICtrlComboBox_AddString($Combo1, $objLogicalDisk.DeviceID & " " & $DriveM & " (" & $TotalMem & "MB)" & " (" & $FileSystem & ")" & " (" & $FreeMem & "MB Free)")
                EndIf
            Next
        Next
        ConsoleWrite(@LF)
    Next
EndFunc   ;==>_flesh_search

Прошу сильно не гнобить,если что не правильно. Скрипт рабочий,только не знаю как привязать ко второму combobox вывод общего размера папок, выделенных чекбоксами. Чтобы заранее знать влезет на флешку или нет. Может кто подправит? Или может как то по другому без combobox?
 

joiner

Модератор
Локальный модератор
Сообщения
3,557
Репутация
628
Hulk777
как я понял, во втором комбо тебе нужен полный размер выбранных файлов. используй не комбо а Label или Input
такое количество элементов можно создавать в цикле. сначала создать массивы со значениями, и потом в цикле создать присваивая значение из массива. это сильно сократит код и он будет легче читаться. пока предлагаю решение подсчета размера файлов. это как пример
Код:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <GuiComboBox.au3>
#include <File.au3>
#include <EditConstants.au3>

$hGUI = GUICreate("Создание флешки", 440, 490, -1, -1)
$iColor = 0xDADADA
GUISetBkColor($iColor)
$font = "Arial"

;Кнопки
$Button1 = GUICtrlCreateButton("Подготовка носителя", 20, 30, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button2 = GUICtrlCreateButton("Установка загрузчика", 220, 30, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

;Группировка
GUICtrlCreateGroup("Подготовка флешки", 10, 10, 420, 60, -1, -1)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
GUICtrlSetColor(-1, 0x0000CD) ; Замена цвета в группе
GUICtrlSetFont(-1, 12, 400, 0, $font) ; Крупный шрифт
GUICtrlSetFont(-1, 12, 700, 0, $font) ; Жирный шрифт

$Checkbox1 = GUICtrlCreateCheckbox("Базовые файлы", 20, 100, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Поддержка UEFI", 20, 120, 100, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Windows 7x86", 20, 140, 90, 17)
$Checkbox4 = GUICtrlCreateCheckbox("Windows 7x64", 20, 160, 90, 17)
$Checkbox5 = GUICtrlCreateCheckbox("Windows 8.1x86", 20, 180, 100, 17)
$Checkbox6 = GUICtrlCreateCheckbox("Windows 8.1x64", 20, 200, 100, 17)
$Checkbox7 = GUICtrlCreateCheckbox("Windows 10x86", 20, 220, 95, 17)
$Checkbox8 = GUICtrlCreateCheckbox("Windows 10x64", 20, 240, 95, 17)
$Checkbox9 = GUICtrlCreateCheckbox("Windows XPx86 (Ver 1)", 20, 260, 130, 17)
$Checkbox10 = GUICtrlCreateCheckbox("Windows XPx86 (Ver 2)", 20, 280, 130, 17)
$Checkbox11 = GUICtrlCreateCheckbox("Linux Mint 15", 220, 100, 80, 17)
$Checkbox12 = GUICtrlCreateCheckbox("Boot USB Sergey Strelec", 220, 120, 140, 17)
$Checkbox13 = GUICtrlCreateCheckbox("Windows Live 2k10", 220, 140, 110, 17)
$Checkbox14 = GUICtrlCreateCheckbox("MSDART & Recovery", 220, 160, 120, 17)
$Checkbox15 = GUICtrlCreateCheckbox("AntiWinBlock", 220, 180, 80, 17)
$Checkbox16 = GUICtrlCreateCheckbox("Hirens Boot 10.6", 220, 200, 100, 17)
$Checkbox17 = GUICtrlCreateCheckbox("Диагност. утилиты", 220, 220, 120, 17)
$Checkbox18 = GUICtrlCreateCheckbox("Сборник Acronis", 220, 240, 100, 17)
$Checkbox19 = GUICtrlCreateCheckbox("Папка с драйверами", 220, 260, 125, 17)
$Checkbox20 = GUICtrlCreateCheckbox("Папка с софтом", 220, 280, 100, 17)
$Checkbox21 = GUICtrlCreateCheckbox("Сформирофать bcd ", 20, 300, 150, 17)
$Checkbox22 = GUICtrlCreateCheckbox("Редактировать menu.lst ", 220, 300, 150, 17)
;Группировка
GUICtrlCreateGroup("Формирование набора", 10, 70, 420, 415, -1, -1)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
GUICtrlSetColor(-1, 0x0000CD) ; Замена цвета в группе
GUICtrlSetFont(-1, 12, 400, 0, $font) ; Крупный шрифт
GUICtrlSetFont(-1, 12, 700, 0, $font) ; Жирный шрифт

$Button3 = GUICtrlCreateButton("По умолчанию", 20, 390, 400, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button4 = GUICtrlCreateButton("Сбросить", 20, 420, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button5 = GUICtrlCreateButton("Применить", 220, 420, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button6 = GUICtrlCreateButton("Выйти из программы", 20, 450, 400, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button7 = GUICtrlCreateButton("Обновить", 350, 330, 70, 25)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button8 = GUICtrlCreateButton("Обновить", 350, 360, 70, 25)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Combo1 = GUICtrlCreateCombo("", 20, 330, 325, 30, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE, $CBS_AUTOHSCROLL))

$Combo2 = GUICtrlCreateInput("", 20, 360, 325, 20, $ES_READONLY)

GUICtrlCreateLabel('(587 МБ)', 120, 102, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\efi") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 125, 122, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win7x86") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 110, 142, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win7x64") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 110, 162, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win8x86") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 120, 182, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win8x64") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 120, 202, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win10x86") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 115, 222, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win10x64") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 115, 242, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\winXPx86\XPpSP31") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 155, 262, 60, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\winXPx86\XPpSP3") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 155, 282, 60, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\mint") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 305, 102, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\sstr") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 360, 122, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\2k10") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 335, 142, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\erdc") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 340, 162, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\awbl") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 305, 182, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\hbcd") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 322, 202, 65, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\util") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 342, 222, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\acrs") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 325, 242, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\2drv") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 345, 262, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\1sft") / 1048576, 2)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 325, 282, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)

Local $AllSize[20], $iSize
Local $n = 0
For $i = 37 To 56
	$AllSize[$n] = StringRegExpReplace(GUICtrlRead($i), '\D', '')
	$n += 1
Next

GUISetState()

While 1
	$MSG = GUIGetMsg()
	Switch $MSG
		Case -3
			Exit
		Case 6 To 25
			If GUICtrlRead($MSG) = 1 Then
				$iSize += $AllSize[$MSG - 6]
				GUICtrlSetData($Combo2, $iSize)
			ElseIf GUICtrlRead($MSG) = 4 Then
				$iSize -= $AllSize[$MSG - 6]
				GUICtrlSetData($Combo2, $iSize)
			EndIf
		Case $Button1
			Run('Utilites\paragon.exe')
		Case $Button2
			Run('Utilites\grub\grubinst_gui.exe')
		Case $Button3
			GUICtrlSetState($Checkbox1, $GUI_CHECKED)
			GUICtrlSetState($Checkbox2, $GUI_CHECKED)
			GUICtrlSetState($Checkbox3, $GUI_CHECKED)
			GUICtrlSetState($Checkbox4, $GUI_CHECKED)
			GUICtrlSetState($Checkbox5, $GUI_CHECKED)
			GUICtrlSetState($Checkbox6, $GUI_CHECKED)
			GUICtrlSetState($Checkbox7, $GUI_CHECKED)
			GUICtrlSetState($Checkbox8, $GUI_CHECKED)
			GUICtrlSetState($Checkbox9, $GUI_CHECKED)
			GUICtrlSetState($Checkbox10, $GUI_CHECKED)
			GUICtrlSetState($Checkbox11, $GUI_CHECKED)
			GUICtrlSetState($Checkbox12, $GUI_CHECKED)
			GUICtrlSetState($Checkbox13, $GUI_CHECKED)
			GUICtrlSetState($Checkbox14, $GUI_CHECKED)
			GUICtrlSetState($Checkbox15, $GUI_CHECKED)
			GUICtrlSetState($Checkbox16, $GUI_CHECKED)
			GUICtrlSetState($Checkbox17, $GUI_CHECKED)
			GUICtrlSetState($Checkbox18, $GUI_CHECKED)
			GUICtrlSetState($Checkbox19, $GUI_CHECKED)
			GUICtrlSetState($Checkbox20, $GUI_CHECKED)
			GUICtrlSetState($Checkbox21, $GUI_CHECKED)
			GUICtrlSetState($Checkbox22, $GUI_CHECKED)
		Case $Button4
			GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox3, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox4, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox5, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox6, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox7, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox8, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox9, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox10, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox11, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox12, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox13, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox14, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox15, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox16, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox17, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox18, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox19, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox20, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox21, $GUI_UNCHECKED)
			GUICtrlSetState($Checkbox22, $GUI_UNCHECKED)
		Case $Button5
			If GUICtrlRead($Checkbox1) = 1 Then RunWait('utilites\scripts\copybase.cmd')
			If GUICtrlRead($Checkbox2) = 1 Then RunWait('utilites\scripts\copyefi.cmd')
			If GUICtrlRead($Checkbox3) = 1 Then RunWait('utilites\scripts\win7x86.cmd')
			If GUICtrlRead($Checkbox4) = 1 Then RunWait('utilites\scripts\win7x64.cmd')
			If GUICtrlRead($Checkbox5) = 1 Then RunWait('utilites\scripts\win81x86.cmd')
			If GUICtrlRead($Checkbox6) = 1 Then RunWait('utilites\scripts\win81x64.cmd')
			If GUICtrlRead($Checkbox7) = 1 Then RunWait('utilites\scripts\win10x86.cmd')
			If GUICtrlRead($Checkbox8) = 1 Then RunWait('utilites\scripts\win10x64.cmd')
			If GUICtrlRead($Checkbox9) = 1 Then RunWait('utilites\scripts\winXPx86(V1).cmd')
			If GUICtrlRead($Checkbox10) = 1 Then RunWait('utilites\scripts\winXPx86(V2).cmd')
			If GUICtrlRead($Checkbox11) = 1 Then RunWait('utilites\scripts\copymint.cmd')
			If GUICtrlRead($Checkbox12) = 1 Then RunWait('utilites\scripts\copysstr.cmd')
			If GUICtrlRead($Checkbox13) = 1 Then RunWait('utilites\scripts\copy2K10.cmd')
			If GUICtrlRead($Checkbox14) = 1 Then RunWait('utilites\scripts\copyerdc.cmd')
			If GUICtrlRead($Checkbox15) = 1 Then RunWait('utilites\scripts\copyawbl.cmd')
			If GUICtrlRead($Checkbox16) = 1 Then RunWait('utilites\scripts\copyhbcd.cmd')
			If GUICtrlRead($Checkbox17) = 1 Then RunWait('utilites\scripts\copyutil.cmd')
			If GUICtrlRead($Checkbox18) = 1 Then RunWait('utilites\scripts\copyacrs.cmd')
			If GUICtrlRead($Checkbox19) = 1 Then RunWait('utilites\scripts\copy2drv.cmd')
			If GUICtrlRead($Checkbox20) = 1 Then RunWait('utilites\scripts\copy1sft.cmd')
			If GUICtrlRead($Checkbox21) = 1 Then RunWait('utilites\scripts\menuedit.cmd')
			If GUICtrlRead($Checkbox22) = 1 Then RunWait('utilites\scripts\menulst.cmd')
		Case $Button6
			Exit
		Case $Button7
			_flesh_search()
	EndSwitch
WEnd

Func _flesh_search()
	$objWMIService = ObjGet("winmgmts:\\.\root\cimv2")
	$colDiskDrives = $objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive")
	For $objDrive In $colDiskDrives
		ConsoleWrite("Physical Disk: " & $objDrive.Caption & @LF)
		$strDeviceID = StringReplace($objDrive.DeviceID, "\", "\\")
		$colPartitions = $objWMIService.ExecQuery('ASSOCIATORS OF {Win32_DiskDrive.DeviceID="' & $strDeviceID & '"} WHERE AssocClass = Win32_DiskDriveToDiskPartition')
		For $objPartition In $colPartitions
			;        ConsoleWrite(@TAB & "Disk Partition: " & $objPartition.DeviceID & @LF)
			$colLogicalDisks = $objWMIService.ExecQuery('ASSOCIATORS OF {Win32_DiskPartition.DeviceID="' & $objPartition.DeviceID & '"} WHERE AssocClass = Win32_LogicalDiskToPartition')
			For $objLogicalDisk In $colLogicalDisks
				If DriveGetType($objLogicalDisk.DeviceID) = "Removable" Then
					ConsoleWrite(@TAB & "Logical Disk: " & $objLogicalDisk.DeviceID & @LF)
					;узнаём объём флехи
					$TotalMemL = DriveSpaceTotal($objLogicalDisk.DeviceID)
					$TotalMem = Round($TotalMemL)
					;узнаём файловую систему
					$FileSystem = DriveGetFileSystem($objLogicalDisk.DeviceID)
					;узнаём свободное места на флешке флешке
					$FreeMemL = DriveSpaceFree($objLogicalDisk.DeviceID)
					$FreeMem = Round($FreeMemL)
					$DriveM = StringReplace($objDrive.Caption, " USB Device", "")
					_GUICtrlComboBox_AddString($Combo1, $objLogicalDisk.DeviceID & " " & $DriveM & " (" & $TotalMem & "MB)" & " (" & $FileSystem & ")" & " (" & $FreeMem & "MB Free)")
				EndIf
			Next
		Next
		ConsoleWrite(@LF)
	Next
EndFunc   ;==>_flesh_search
 
Автор
H

Hulk777

Новичок
Сообщения
72
Репутация
1
Попробовал. Работает. Только почему то две папки вместо 4,5 гигов показывает 330 метров. А где красным шрифтом, отображается верно. Не знаете что это. А то на выходе имею разницу большую между реальным объемом и в общем показателе. А еще только заметил во всех показателях, если по одному выделять разница в 100 метров. На выходе больше 6 гигабайт разницы.
 

joiner

Модератор
Локальный модератор
Сообщения
3,557
Репутация
628
используй вместо Round функцию Ceiling. она округляет в большую сторону
Код:
$iSize = Ceiling(DirGetSize("flash\core\win7x64") / 1048576)
 
Автор
H

Hulk777

Новичок
Сообщения
72
Репутация
1
Вроде дошло. Функцию оставил старую. Попробовал со знаками после запятой поиграть. Считает почти точно.
 

joiner

Модератор
Локальный модератор
Сообщения
3,557
Репутация
628
не будут учитываться килобайты. в итоге размер реальный будет больше, чем вернет функция Round
 
Автор
H

Hulk777

Новичок
Сообщения
72
Репутация
1
С функцией Ceiling показывает вместо 2 гб - 11 мб.
 

joiner

Модератор
Локальный модератор
Сообщения
3,557
Репутация
628
не может быть. у меня все показывает нормально. выдели строку в отдельный скрипт и проверь. потом проверь свойства папки. сравни размеры
 
Автор
H

Hulk777

Новичок
Сообщения
72
Репутация
1
Красным 2695, в сумме 12646, в свойствах 2,63 ГБ (2 824 872 245 байт) по Win7x64. Может что не так делаю? Совместил размеры красного и в свойствах. Но ячейка сумма не выходит даже близко.
 

joiner

Модератор
Локальный модератор
Сообщения
3,557
Репутация
628
2695 = 2Гб 695Мб
 
Автор
H

Hulk777

Новичок
Сообщения
72
Репутация
1
Код:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <GuiComboBox.au3>
#include <File.au3>
#include <EditConstants.au3>
Global $textDef="Общий размер выделенного (без восьми последних-это Мб)"

$hGUI = GUICreate("Создание флешки", 440, 490, -1, -1)
$iColor = 0xDADADA
GUISetBkColor($iColor)
$font = "Arial"

;Кнопки
$Button1 = GUICtrlCreateButton("Подготовка носителя", 20, 30, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button2 = GUICtrlCreateButton("Установка загрузчика", 220, 30, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

;Группировка
GUICtrlCreateGroup("Подготовка флешки", 10, 10, 420, 60, -1, -1)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
GUICtrlSetColor(-1, 0x0000CD) ; Замена цвета в группе
GUICtrlSetFont(-1, 12, 400, 0, $font) ; Крупный шрифт
GUICtrlSetFont(-1, 12, 700, 0, $font) ; Жирный шрифт

$Checkbox1 = GUICtrlCreateCheckbox("Базовые файлы", 20, 100, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Поддержка UEFI", 20, 120, 100, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Windows 7x86", 20, 140, 90, 17)
$Checkbox4 = GUICtrlCreateCheckbox("Windows 7x64", 20, 160, 90, 17)
$Checkbox5 = GUICtrlCreateCheckbox("Windows 8.1x86", 20, 180, 100, 17)
$Checkbox6 = GUICtrlCreateCheckbox("Windows 8.1x64", 20, 200, 100, 17)
$Checkbox7 = GUICtrlCreateCheckbox("Windows 10x86", 20, 220, 95, 17)
$Checkbox8 = GUICtrlCreateCheckbox("Windows 10x64", 20, 240, 95, 17)
$Checkbox9 = GUICtrlCreateCheckbox("Windows XPx86 (V1)", 20, 260, 120, 17)
$Checkbox10 = GUICtrlCreateCheckbox("Windows XPx86 (V2)", 20, 280, 120, 17)
$Checkbox11 = GUICtrlCreateCheckbox("Linux Mint 15", 220, 100, 80, 17)
$Checkbox12 = GUICtrlCreateCheckbox("Live Sergey Strelec", 220, 120, 120, 17)
$Checkbox13 = GUICtrlCreateCheckbox("Windows Live 2k10", 220, 140, 110, 17)
$Checkbox14 = GUICtrlCreateCheckbox("MSDART & Recovery", 220, 160, 120, 17)
$Checkbox15 = GUICtrlCreateCheckbox("AntiWinBlock", 220, 180, 80, 17)
$Checkbox16 = GUICtrlCreateCheckbox("Hirens Boot 10.6", 220, 200, 100, 17)
$Checkbox17 = GUICtrlCreateCheckbox("Диагност. утилиты", 220, 220, 120, 17)
$Checkbox18 = GUICtrlCreateCheckbox("Сборник Acronis", 220, 240, 100, 17)
$Checkbox19 = GUICtrlCreateCheckbox("Папка с драйверами", 220, 260, 125, 17)
$Checkbox20 = GUICtrlCreateCheckbox("Папка с софтом", 220, 280, 100, 17)
$Checkbox21 = GUICtrlCreateCheckbox("Сформирофать bcd ", 20, 300, 150, 17)
$Checkbox22 = GUICtrlCreateCheckbox("Редактировать menu.lst ", 220, 300, 150, 17)
;Группировка
GUICtrlCreateGroup("Формирование набора", 10, 70, 420, 415, -1, -1)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
GUICtrlSetColor(-1, 0x0000CD) ; Замена цвета в группе
GUICtrlSetFont(-1, 12, 400, 0, $font) ; Крупный шрифт
GUICtrlSetFont(-1, 12, 700, 0, $font) ; Жирный шрифт

$Button3 = GUICtrlCreateButton("По умолчанию", 20, 390, 400, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button4 = GUICtrlCreateButton("Сбросить", 20, 420, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button5 = GUICtrlCreateButton("Применить", 220, 420, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button6 = GUICtrlCreateButton("Выйти из программы", 20, 450, 400, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button7 = GUICtrlCreateButton("Обновить", 350, 330, 70, 25)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button8 = GUICtrlCreateButton("Сбросить", 350, 360, 70, 25)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Combo1 = GUICtrlCreateCombo("", 20, 330, 325, 30, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE, $CBS_AUTOHSCROLL))

$Input1 = GUICtrlCreateInput($textDef, 20, 360, 325, 20)

GUICtrlCreateLabel('(37.5243 Мб)', 125, 102, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\efi") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 125, 122, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win7x86") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 110, 142, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win7x64") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 110, 162, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win8x86") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 120, 182, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win8x64") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 120, 202, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win10x86") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 115, 222, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win10x64") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 115, 242, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\winXPx86\XPpSP31") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 140, 262, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\winXPx86\XPpSP3") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 140, 282, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\mint") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 305, 102, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\sstr") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 335, 122, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\2k10") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 335, 142, 85, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\erdc") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 340, 162, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\awbl") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 305, 182, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\hbcd") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 322, 202, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\util") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 342, 222, 85, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\acrs") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 325, 242, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\2drv") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 345, 262, 82, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\1sft") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 325, 282, 90, 12)
GUICtrlSetColor(-1, 0xFF0000)

Local $AllSize[20], $iSize
Local $n = 0
For $i = 37 To 56
    $AllSize[$n] = StringRegExpReplace(GUICtrlRead($i), '\D', '')
    $n += 1
Next

GUISetState()

While 1
    $MSG = GUIGetMsg()
    Switch $MSG
        Case -3
            Exit
        Case 6 To 25
            If GUICtrlRead($MSG) = 1 Then
                $iSize += $AllSize[$MSG - 6]
                ConsoleWrite($iSize)
                GUICtrlSetData($Input1, $iSize)
            ElseIf GUICtrlRead($MSG) = 4 Then
                $iSize -= $AllSize[$MSG - 6]
                GUICtrlSetData($Input1, $iSize)
            EndIf
        Case $Button1
            Run('Utilites\paragon.exe')
        Case $Button2
            Run('Utilites\grub\grubinst_gui.exe')
        Case $Button3
            GUICtrlSetState($Checkbox1, $GUI_CHECKED)
            GUICtrlSetState($Checkbox2, $GUI_CHECKED)
            GUICtrlSetState($Checkbox3, $GUI_CHECKED)
            GUICtrlSetState($Checkbox4, $GUI_CHECKED)
            GUICtrlSetState($Checkbox5, $GUI_CHECKED)
            GUICtrlSetState($Checkbox6, $GUI_CHECKED)
            GUICtrlSetState($Checkbox7, $GUI_CHECKED)
            GUICtrlSetState($Checkbox8, $GUI_CHECKED)
            GUICtrlSetState($Checkbox9, $GUI_CHECKED)
            GUICtrlSetState($Checkbox10, $GUI_CHECKED)
            GUICtrlSetState($Checkbox11, $GUI_CHECKED)
            GUICtrlSetState($Checkbox12, $GUI_CHECKED)
            GUICtrlSetState($Checkbox13, $GUI_CHECKED)
            GUICtrlSetState($Checkbox14, $GUI_CHECKED)
            GUICtrlSetState($Checkbox15, $GUI_CHECKED)
            GUICtrlSetState($Checkbox16, $GUI_CHECKED)
            GUICtrlSetState($Checkbox17, $GUI_CHECKED)
            GUICtrlSetState($Checkbox18, $GUI_CHECKED)
            GUICtrlSetState($Checkbox19, $GUI_CHECKED)
            GUICtrlSetState($Checkbox20, $GUI_CHECKED)
            GUICtrlSetState($Checkbox21, $GUI_CHECKED)
            GUICtrlSetState($Checkbox22, $GUI_CHECKED)
        Case $Button4
            GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox3, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox4, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox5, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox6, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox7, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox8, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox9, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox10, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox11, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox12, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox13, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox14, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox15, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox16, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox17, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox18, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox19, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox20, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox21, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox22, $GUI_UNCHECKED)
        Case $Button5
            If GUICtrlRead($Checkbox1) = 1 Then RunWait('utilites\scripts\copybase.cmd')
            If GUICtrlRead($Checkbox2) = 1 Then RunWait('utilites\scripts\copyefi.cmd')
            If GUICtrlRead($Checkbox3) = 1 Then RunWait('utilites\scripts\win7x86.cmd')
            If GUICtrlRead($Checkbox4) = 1 Then RunWait('utilites\scripts\win7x64.cmd')
            If GUICtrlRead($Checkbox5) = 1 Then RunWait('utilites\scripts\win81x86.cmd')
            If GUICtrlRead($Checkbox6) = 1 Then RunWait('utilites\scripts\win81x64.cmd')
            If GUICtrlRead($Checkbox7) = 1 Then RunWait('utilites\scripts\win10x86.cmd')
            If GUICtrlRead($Checkbox8) = 1 Then RunWait('utilites\scripts\win10x64.cmd')
            If GUICtrlRead($Checkbox9) = 1 Then RunWait('utilites\scripts\winXPx86.cmd')
            If GUICtrlRead($Checkbox10) = 1 Then RunWait('utilites\scripts\winXPx862.cmd')
            If GUICtrlRead($Checkbox11) = 1 Then RunWait('utilites\scripts\copymint.cmd')
            If GUICtrlRead($Checkbox12) = 1 Then RunWait('utilites\scripts\copysstr.cmd')
            If GUICtrlRead($Checkbox13) = 1 Then RunWait('utilites\scripts\copy2K10.cmd')
            If GUICtrlRead($Checkbox14) = 1 Then RunWait('utilites\scripts\copyerdc.cmd')
            If GUICtrlRead($Checkbox15) = 1 Then RunWait('utilites\scripts\copyawbl.cmd')
            If GUICtrlRead($Checkbox16) = 1 Then RunWait('utilites\scripts\copyhbcd.cmd')
            If GUICtrlRead($Checkbox17) = 1 Then RunWait('utilites\scripts\copyutil.cmd')
            If GUICtrlRead($Checkbox18) = 1 Then RunWait('utilites\scripts\copyacrs.cmd')
            If GUICtrlRead($Checkbox19) = 1 Then RunWait('utilites\scripts\copy2drv.cmd')
            If GUICtrlRead($Checkbox20) = 1 Then RunWait('utilites\scripts\copy1sft.cmd')
            If GUICtrlRead($Checkbox21) = 1 Then RunWait('utilites\scripts\menuedit.cmd')
            If GUICtrlRead($Checkbox22) = 1 Then RunWait('utilites\scripts\menulst.cmd')
        Case $Button6
            Exit
        Case $Button7
            _flesh_search()
    EndSwitch
WEnd

Func _flesh_search()
    $objWMIService = ObjGet("winmgmts:\\.\root\cimv2")
    $colDiskDrives = $objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive")
    For $objDrive In $colDiskDrives
        ConsoleWrite("Physical Disk: " & $objDrive.Caption & @LF)
        $strDeviceID = StringReplace($objDrive.DeviceID, "\", "\\")
        $colPartitions = $objWMIService.ExecQuery('ASSOCIATORS OF {Win32_DiskDrive.DeviceID="' & $strDeviceID & '"} WHERE AssocClass = Win32_DiskDriveToDiskPartition')
        For $objPartition In $colPartitions
            ;        ConsoleWrite(@TAB & "Disk Partition: " & $objPartition.DeviceID & @LF)
            $colLogicalDisks = $objWMIService.ExecQuery('ASSOCIATORS OF {Win32_DiskPartition.DeviceID="' & $objPartition.DeviceID & '"} WHERE AssocClass = Win32_LogicalDiskToPartition')
            For $objLogicalDisk In $colLogicalDisks
                If DriveGetType($objLogicalDisk.DeviceID) = "Removable" Then
                    ConsoleWrite(@TAB & "Logical Disk: " & $objLogicalDisk.DeviceID & @LF)
                    ;узнаём объём флехи
                    $TotalMemL = DriveSpaceTotal($objLogicalDisk.DeviceID)
                    $TotalMem = Round($TotalMemL)
                    ;узнаём файловую систему
                    $FileSystem = DriveGetFileSystem($objLogicalDisk.DeviceID)
                    ;узнаём свободное места на флешке флешке
                    $FreeMemL = DriveSpaceFree($objLogicalDisk.DeviceID)
                    $FreeMem = Round($FreeMemL)
                    $DriveM = StringReplace($objDrive.Caption, " USB Device", "")
                    _GUICtrlComboBox_AddString($Combo1, $objLogicalDisk.DeviceID & " " & $DriveM & " (" & $TotalMem & "MB)" & " (" & $FileSystem & ")" & " (" & $FreeMem & "MB Free)")
                EndIf
            Next
        Next
        ConsoleWrite(@LF)
    Next
EndFunc   ;==>_flesh_search

Почти что хотел, все получилось. Спасибо за терпение. Имею на выходе из 50 гигов 30 метров погрешности. Для меня это не критично. Помогите со сбросом значений в input , а так же дописать в input после значения Мб, если не затруднит.


Добавлено:
Сообщение автоматически объединено:

Код:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <GuiComboBox.au3>
#include <File.au3>
#include <EditConstants.au3>
Global $textDef="Общий размер выделенного (без восьми последних-это Мб)"

$hGUI = GUICreate("Создание флешки", 440, 490, -1, -1)
$iColor = 0xDADADA
GUISetBkColor($iColor)
$font = "Arial"

;Кнопки
$Button1 = GUICtrlCreateButton("Подготовка носителя", 20, 30, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button2 = GUICtrlCreateButton("Установка загрузчика", 220, 30, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

;Группировка
GUICtrlCreateGroup("Подготовка флешки", 10, 10, 420, 60, -1, -1)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
GUICtrlSetColor(-1, 0x0000CD) ; Замена цвета в группе
GUICtrlSetFont(-1, 12, 400, 0, $font) ; Крупный шрифт
GUICtrlSetFont(-1, 12, 700, 0, $font) ; Жирный шрифт

$Checkbox1 = GUICtrlCreateCheckbox("Базовые файлы", 20, 100, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Поддержка UEFI", 20, 120, 100, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Windows 7x86", 20, 140, 90, 17)
$Checkbox4 = GUICtrlCreateCheckbox("Windows 7x64", 20, 160, 90, 17)
$Checkbox5 = GUICtrlCreateCheckbox("Windows 8.1x86", 20, 180, 100, 17)
$Checkbox6 = GUICtrlCreateCheckbox("Windows 8.1x64", 20, 200, 100, 17)
$Checkbox7 = GUICtrlCreateCheckbox("Windows 10x86", 20, 220, 95, 17)
$Checkbox8 = GUICtrlCreateCheckbox("Windows 10x64", 20, 240, 95, 17)
$Checkbox9 = GUICtrlCreateCheckbox("Windows XPx86 (V1)", 20, 260, 120, 17)
$Checkbox10 = GUICtrlCreateCheckbox("Windows XPx86 (V2)", 20, 280, 120, 17)
$Checkbox11 = GUICtrlCreateCheckbox("Linux Mint 15", 220, 100, 80, 17)
$Checkbox12 = GUICtrlCreateCheckbox("Live Sergei Strelec", 220, 120, 120, 17)
$Checkbox13 = GUICtrlCreateCheckbox("Windows Live 2k10", 220, 140, 110, 17)
$Checkbox14 = GUICtrlCreateCheckbox("MSDART & Recovery", 220, 160, 120, 17)
$Checkbox15 = GUICtrlCreateCheckbox("AntiWinBlock", 220, 180, 80, 17)
$Checkbox16 = GUICtrlCreateCheckbox("Hirens Boot 10.6", 220, 200, 100, 17)
$Checkbox17 = GUICtrlCreateCheckbox("Диагност. утилиты", 220, 220, 120, 17)
$Checkbox18 = GUICtrlCreateCheckbox("Сборник Acronis", 220, 240, 100, 17)
$Checkbox19 = GUICtrlCreateCheckbox("Папка с драйверами", 220, 260, 125, 17)
$Checkbox20 = GUICtrlCreateCheckbox("Папка с софтом", 220, 280, 100, 17)
$Checkbox21 = GUICtrlCreateCheckbox("Сформирофать bcd ", 20, 300, 150, 17)
$Checkbox22 = GUICtrlCreateCheckbox("Редактировать menu.lst ", 220, 300, 150, 17)
;Группировка
GUICtrlCreateGroup("Формирование набора", 10, 70, 420, 415, -1, -1)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
GUICtrlSetColor(-1, 0x0000CD) ; Замена цвета в группе
GUICtrlSetFont(-1, 12, 400, 0, $font) ; Крупный шрифт
GUICtrlSetFont(-1, 12, 700, 0, $font) ; Жирный шрифт

$Button3 = GUICtrlCreateButton("По умолчанию", 20, 390, 400, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button4 = GUICtrlCreateButton("Сбросить", 20, 420, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button5 = GUICtrlCreateButton("Применить", 220, 420, 200, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button6 = GUICtrlCreateButton("Выйти из программы", 20, 450, 400, 30)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button7 = GUICtrlCreateButton("Обновить", 350, 330, 70, 25)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Button8 = GUICtrlCreateButton("Очистить", 350, 360, 70, 25)
GUICtrlSetFont(-1, 10, 700, 0, $font) ; Жирный шрифт

$Combo1 = GUICtrlCreateCombo("", 20, 330, 325, 30, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE, $CBS_AUTOHSCROLL))

$Input1 = GUICtrlCreateInput($textDef, 20, 360, 325, 20)

GUICtrlCreateLabel('(37.5243 Мб)', 125, 102, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\efi") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 125, 122, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win7x86") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 110, 142, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win7x64") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 110, 162, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win8x86") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 120, 182, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win8x64") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 120, 202, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win10x86") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 115, 222, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\win10x64") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 115, 242, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\winXPx86\XPpSP31") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 140, 262, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\core\winXPx86\XPpSP3") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 140, 282, 70, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\mint") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 305, 102, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\sstr") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 335, 122, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\2k10") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 335, 142, 85, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\erdc") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 340, 162, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\awbl") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 305, 182, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\hbcd") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 322, 202, 75, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\util") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 342, 222, 85, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\acrs") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 325, 242, 80, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\2drv") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 345, 262, 82, 12)
GUICtrlSetColor(-1, 0xFF0000)
$iSize = Round(DirGetSize("flash\1sft") / 1000576, 4)
$Label = GUICtrlCreateLabel("(" & $iSize & " Мб)", 325, 282, 90, 12)
GUICtrlSetColor(-1, 0xFF0000)

Local $AllSize[20], $iSize
Local $n = 0
For $i = 37 To 56
    $AllSize[$n] = StringRegExpReplace(GUICtrlRead($i), '\D', '')
    $n += 1
Next

GUISetState()

While 1
    $MSG = GUIGetMsg()
    Switch $MSG
        Case -3
            Exit
        Case 6 To 25
            If GUICtrlRead($MSG) = 1 Then
                $iSize += $AllSize[$MSG - 6]
                ConsoleWrite($iSize)
                GUICtrlSetData($Input1, $iSize)
            ElseIf GUICtrlRead($MSG) = 4 Then
                $iSize -= $AllSize[$MSG - 6]
                GUICtrlSetData($Input1, $iSize)
            EndIf
        Case $Button1
            Run('Utilites\paragon.exe')
        Case $Button2
            Run('Utilites\grub\grubinst_gui.exe')
        Case $Button3
            GUICtrlSetState($Checkbox1, $GUI_CHECKED)
            GUICtrlSetState($Checkbox2, $GUI_CHECKED)
            GUICtrlSetState($Checkbox3, $GUI_CHECKED)
            GUICtrlSetState($Checkbox4, $GUI_CHECKED)
            GUICtrlSetState($Checkbox5, $GUI_CHECKED)
            GUICtrlSetState($Checkbox6, $GUI_CHECKED)
            GUICtrlSetState($Checkbox7, $GUI_CHECKED)
            GUICtrlSetState($Checkbox8, $GUI_CHECKED)
            GUICtrlSetState($Checkbox9, $GUI_CHECKED)
            GUICtrlSetState($Checkbox10, $GUI_CHECKED)
            GUICtrlSetState($Checkbox11, $GUI_CHECKED)
            GUICtrlSetState($Checkbox12, $GUI_CHECKED)
            GUICtrlSetState($Checkbox13, $GUI_CHECKED)
            GUICtrlSetState($Checkbox14, $GUI_CHECKED)
            GUICtrlSetState($Checkbox15, $GUI_CHECKED)
            GUICtrlSetState($Checkbox16, $GUI_CHECKED)
            GUICtrlSetState($Checkbox17, $GUI_CHECKED)
            GUICtrlSetState($Checkbox18, $GUI_CHECKED)
            GUICtrlSetState($Checkbox19, $GUI_CHECKED)
            GUICtrlSetState($Checkbox20, $GUI_CHECKED)
            GUICtrlSetState($Checkbox21, $GUI_CHECKED)
            GUICtrlSetState($Checkbox22, $GUI_CHECKED)
        Case $Button4
            GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox3, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox4, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox5, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox6, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox7, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox8, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox9, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox10, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox11, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox12, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox13, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox14, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox15, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox16, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox17, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox18, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox19, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox20, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox21, $GUI_UNCHECKED)
            GUICtrlSetState($Checkbox22, $GUI_UNCHECKED)
        Case $Button5
            If GUICtrlRead($Checkbox1) = 1 Then RunWait('utilites\scripts\copybase.cmd')
            If GUICtrlRead($Checkbox2) = 1 Then RunWait('utilites\scripts\copyefi.cmd')
            If GUICtrlRead($Checkbox3) = 1 Then RunWait('utilites\scripts\win7x86.cmd')
            If GUICtrlRead($Checkbox4) = 1 Then RunWait('utilites\scripts\win7x64.cmd')
            If GUICtrlRead($Checkbox5) = 1 Then RunWait('utilites\scripts\win81x86.cmd')
            If GUICtrlRead($Checkbox6) = 1 Then RunWait('utilites\scripts\win81x64.cmd')
            If GUICtrlRead($Checkbox7) = 1 Then RunWait('utilites\scripts\win10x86.cmd')
            If GUICtrlRead($Checkbox8) = 1 Then RunWait('utilites\scripts\win10x64.cmd')
            If GUICtrlRead($Checkbox9) = 1 Then RunWait('utilites\scripts\winXPx86.cmd')
            If GUICtrlRead($Checkbox10) = 1 Then RunWait('utilites\scripts\winXPx862.cmd')
            If GUICtrlRead($Checkbox11) = 1 Then RunWait('utilites\scripts\copymint.cmd')
            If GUICtrlRead($Checkbox12) = 1 Then RunWait('utilites\scripts\copysstr.cmd')
            If GUICtrlRead($Checkbox13) = 1 Then RunWait('utilites\scripts\copy2K10.cmd')
            If GUICtrlRead($Checkbox14) = 1 Then RunWait('utilites\scripts\copyerdc.cmd')
            If GUICtrlRead($Checkbox15) = 1 Then RunWait('utilites\scripts\copyawbl.cmd')
            If GUICtrlRead($Checkbox16) = 1 Then RunWait('utilites\scripts\copyhbcd.cmd')
            If GUICtrlRead($Checkbox17) = 1 Then RunWait('utilites\scripts\copyutil.cmd')
            If GUICtrlRead($Checkbox18) = 1 Then RunWait('utilites\scripts\copyacrs.cmd')
            If GUICtrlRead($Checkbox19) = 1 Then RunWait('utilites\scripts\copy2drv.cmd')
            If GUICtrlRead($Checkbox20) = 1 Then RunWait('utilites\scripts\copy1sft.cmd')
            If GUICtrlRead($Checkbox21) = 1 Then RunWait('utilites\scripts\menuedit.cmd')
            If GUICtrlRead($Checkbox22) = 1 Then RunWait('utilites\scripts\menulst.cmd')
        Case $Button6
            Exit
        Case $Button7
            _flesh_search()
        Case $Button8
         GUICtrlSetData($input1, "")
    EndSwitch
WEnd

Func _flesh_search()
    $objWMIService = ObjGet("winmgmts:\\.\root\cimv2")
    $colDiskDrives = $objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive")
    For $objDrive In $colDiskDrives
        ConsoleWrite("Physical Disk: " & $objDrive.Caption & @LF)
        $strDeviceID = StringReplace($objDrive.DeviceID, "\", "\\")
        $colPartitions = $objWMIService.ExecQuery('ASSOCIATORS OF {Win32_DiskDrive.DeviceID="' & $strDeviceID & '"} WHERE AssocClass = Win32_DiskDriveToDiskPartition')
        For $objPartition In $colPartitions
            ;        ConsoleWrite(@TAB & "Disk Partition: " & $objPartition.DeviceID & @LF)
            $colLogicalDisks = $objWMIService.ExecQuery('ASSOCIATORS OF {Win32_DiskPartition.DeviceID="' & $objPartition.DeviceID & '"} WHERE AssocClass = Win32_LogicalDiskToPartition')
            For $objLogicalDisk In $colLogicalDisks
                If DriveGetType($objLogicalDisk.DeviceID) = "Removable" Then
                    ConsoleWrite(@TAB & "Logical Disk: " & $objLogicalDisk.DeviceID & @LF)
                    ;узнаём объём флехи
                    $TotalMemL = DriveSpaceTotal($objLogicalDisk.DeviceID)
                    $TotalMem = Round($TotalMemL)
                    ;узнаём файловую систему
                    $FileSystem = DriveGetFileSystem($objLogicalDisk.DeviceID)
                    ;узнаём свободное места на флешке флешке
                    $FreeMemL = DriveSpaceFree($objLogicalDisk.DeviceID)
                    $FreeMem = Round($FreeMemL)
                    $DriveM = StringReplace($objDrive.Caption, " USB Device", "")
                    _GUICtrlComboBox_AddString($Combo1, $objLogicalDisk.DeviceID & " " & $DriveM & " (" & $TotalMem & "MB)" & " (" & $FileSystem & ")" & " (" & $FreeMem & "MB Free)")
                EndIf
            Next
        Next
        ConsoleWrite(@LF)
    Next
EndFunc   ;==>_flesh_search

С input разобрался.
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
Hulk777,
[info border=#0000ff float=left]На форуме принято помечать тему решенной после получения ответа на свой вопрос!
Вверху или внизу темы нажмите на ссылку такого вида:
package_old.gif
Тема не решена
[/info]
 
Верх