This is the capture wim compliment to blog

Using KBE manipulator you can create dedicated KBE’s set to capture an image to a specific location.

Since I am using DISM to deploy my wims I am using winpe5

First we will create HTA files and place them in you directory you use to upload portable applications to the KBEM

If you have not used this feature prior create a dedicated directory on your tech station that you will place these files in as well as the remap exe's you created using AutoIT in this blog:


Use Notepad++ or Wordpad to paste this code and save as a HTA file like pictured above (Capture_wim.hta = this generic HTA Code)

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="deployment_client.css" />

<title>WIM Capture</title>

<script language="VBScript">
'Resize window
Sub Window_onLoad
window.resizeTo 400,400
End Sub

'Verify t:\imagestore exists
Sub StartCapture

Dim imgForm
Set imgForm = Document.forms("imgForm")

Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists ("t:\imagestore") Then
Set objFolder = objFSO.CreateFolder("t:\imagestore")
End if

'Verify image is not already on T:\imagestore
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("t:\imagestore\" & imgForm.imgName.value & ".wim") Then
MsgBox("The WIM image already exists. Please use a different name")
ElseIf imgForm.imgName.value = "" Then
MsgBox("A blank name is not allowed.")
'Start Image Capture
strCommand = "%systemdrive%\windows\system32\imagex.exe /capture /verify /compress" & " " & imgForm.comPrs.value & " " & imgForm.srcDrive.value & ":" & " " & "t:\imagestore\" & imgForm.imgName.value & ".wim" & " " & "'" & imgForm.imgName.value & "'" & " " & "/logfile" & " " & "t:\imagestore\" & imgForm.imgName.value & ".log"
Set wshShell = CreateObject("WScript.Shell") strCommand
'MsgBox("Process Complete. Check T:\imagestore\" & imgForm.imgName.value & ".log for errors" )
Set WshShell = nothing
End If
End Sub


<h1>WIM Capture</h1>

<form id="imgForm" action="">
<div class="list">Image Name: <input type="text" name="imgName" id="imgName" size="20" maxlength="10">.wim</div>
<div class="list">Source Drive: <input type="text" name="srcDrive" id="srcDrive" size="1" maxlength="1">:</div<br/>

<table><tr><td VALIGN="baseline">
<div class="list">Compression: </div>
<td VALIGN="baseline">
<select name="comPrs" id="comPrs">---
<option value="fast">Fast</option>
<option value="maximum">Maximum</option>
<option value="none">None</option>
<div class="text"><em>Note: Images will be sent to t:\imagestore\.</em></div<br/>
<input type="button" value="Start Capture" name="StartCapture" onClick="StartCapture">

<span id = "DataArea"></span>


I prefer to create multiple HTA’s that display the path the captured WIM will go to.

To create a custom HTA for each server, change this line in the code. (This only changes the user display, does not actually control the capture location, the map.exe does that)

<div class="text"><em>Note: Images will be sent to t:\imagestore\.</em></div<br/>
to something more specific to suit your needs
<div class="text"><em>Note: Images will be sent to \\msacad2\k2000\images\imagestore\.</em></div<br/>

Start the KBEM and choose the tool kit


Fill in the KBE information


From the configure dropdown choose “Modify KBE Tools”


Check “add Files to KBE”

Browse to and choose the location of the local directory you want to upload to x:\applications.

Uncheck “Kace Deployment Menu”


From the configure dropdown choose “Add custom DOS command(s)”


Call the remap and hta file from the x:\applications directory


 Say OK and Click create KBE:


Using the KBE you just created:

Pxe boot and choose the KBE for capturing and let it load


File in the name of the WIM and drive letter and click capture.

Generic Capture HTA


modified Capture HTA