#include #include #include #include #include #include WinSetState("[CLASS:ConsoleWindowClass]", "", @SW_HIDE) GUICreate("", 344, 210,-1, -1, $WS_POPUPWINDOW) GUICtrlCreateLabel("Bron schijfletter:", 24, 8) $DRIVELETTER = GUICtrlCreateInput("", 24, 32, 97, 21) GUICtrlSetState($DRIVELETTER, $GUI_DISABLE) $SELECTDRIVE = GUICtrlCreateButton("...", 128, 32, 27, 17) GUICtrlCreateLabel("Gevonden OS:", 184, 8, 75, 17) $FOUNDOS = GUICtrlCreateInput("", 184, 32, 137, 21) GUICtrlSetState($FOUNDOS, $GUI_DISABLE) GUICtrlCreateGroup("Geïnstalleerd OS", 24, 64, 297, 97) $WIN7EMB = GUICtrlCreateCheckbox("Windows 7 Embedded", 32, 88, 137, 17) $WIN7X86 = GUICtrlCreateCheckbox("Windows 7 - 32Bit", 32, 112, 137, 17) $WIN7AMD64 = GUICtrlCreateCheckbox("Windows 7 - 64Bit", 32, 136, 113, 17) $WIN81EMB = GUICtrlCreateCheckbox("Windows 8.1 Embedded", 176, 88, 137, 17) $WIN81AMD64 = GUICtrlCreateCheckbox("Windows 8.1 - 64Bit", 176, 112, 137, 17) $WIN10 = GUICtrlCreateCheckbox("Windows 10", 176, 136, 97, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $START = GUICtrlCreateButton("Start", 134, 176, 75, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Select Case $Msg = $SELECTDRIVE SelectSource() Case $nMsg = $START ERRORCATCH() Case $Msg = $GUI_EVENT_CLOSE $YesOrNo = msgBox(4,"","Weet je zeker dat je wilt stoppen?") If $YesOrNo = 6 then WinSetState("[CLASS:ConsoleWindowClass]", "", @SW_SHOW) Exit EndIf Case $msg = $WIN7EMB If GUICtrlRead($WIN7EMB) = $GUI_CHECKED Then GUICtrlSetState($WIN7X86, $GUI_DISABLE) GUICtrlSetState($WIN7AMD64, $GUI_DISABLE) EndIf If GUICtrlRead($UEFI) = $GUI_UNCHECKED Then GUICtrlSetState($BIOS, $GUI_ENABLE) EndIf EndSelect WEnd Func SelectSource() $SourceData = FileSelectFolder("Kies bron schijf.", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") GUICtrlSetData($DRIVELETTER, $SourceData) If FileExists($SourceData & "Program Files\Outlook Express") Then GUICtrlSetData($FOUNDOS, "Windows XP") EndIf If FileExists($SourceData & "Program Files\Windows Mail") Then GUICtrlSetData($FOUNDOS, "Vista or above") EndIf $EMPTY = GUICtrlRead($FOUNDOS) If $EMPTY = "" Then GUICtrlSetData($FOUNDOS, "Unknown") EndIf EndFunc Func ERRORCATCH() $GO = 1 If GUICtrlRead($DRIVELETTER) = "" Then $GO = 0 EndIf If $GO = 1 Then Start() EndIf EndFunc Func Start() GUICtrlSetState($SELECTDRIVE, $GUI_DISABLE) GUICtrlSetState($WIN7EMB, $GUI_DISABLE) GUICtrlSetState($WIN7X86, $GUI_DISABLE) GUICtrlSetState($WIN7AMD64, $GUI_DISABLE) GUICtrlSetState($WIN81EMB, $GUI_DISABLE) GUICtrlSetState($WIN81AMD64, $GUI_DISABLE) GUICtrlSetState($WIN10, $GUI_DISABLE) GUICtrlSetState($START, $GUI_DISABLE) If GUICtrlRead($WIN7EMB) = $GUI_CHECKED Then $VAR1 = "CAPTURE-WIN7-EMBEDDED.WIM" If GUICtrlRead($WIN7EMB) = $GUI_CHECKED Then $VAR2 = "EMBEDDED" If GUICtrlRead($WIN7X86) = $GUI_CHECKED Then $VAR1 = "CAPTURE-WIN7-X86.WIM" If GUICtrlRead($WIN7X86) = $GUI_CHECKED Then $VAR2 = "X86" If GUICtrlRead($WIN7AMD64) = $GUI_CHECKED Then $VAR1 = "CAPTURE-WIN7-X64.WIM" If GUICtrlRead($WIN7AMD64) = $GUI_CHECKED Then $VAR2 = "AMD64" If GUICtrlRead($WIN81EMB) = $GUI_CHECKED Then $VAR1 = "CAPTURE-WIN81-EMBEDDED.WIM" If GUICtrlRead($WIN81EMB) = $GUI_CHECKED Then $VAR2 = "EMBEDDED" If GUICtrlRead($WIN81AMD64) = $GUI_CHECKED Then $VAR1 = "CAPTURE-WIN81-X64.WIM" If GUICtrlRead($WIN81AMD64) = $GUI_CHECKED Then $VAR2 = "AMD64" If GUICtrlRead($WIN10) = $GUI_CHECKED Then $VAR1 = "CAPTURE-WIN10-X64.WIM" If GUICtrlRead($WIN10) = $GUI_CHECKED Then $VAR2 = "CAPTURE-WIN10-X64.WIM" $VAR3 = GUICtrlRead($DRIVELETTER) $FILE = "P:\Script\Capture\capture.cmd" FileCopy($FILE, "X:\", 1) $FILE = "X:\capture.cmd" _ReplaceStringInFile($FILE, "VAR1", $VAR1) _ReplaceStringInFile($FILE, "VAR2", $VAR2) _ReplaceStringInFile($FILE, "VAR3", $VAR3) RunWait("X:\capture.cmd") EndFunc