/build/static/layout/Breadcrumb_cap_w.png

Capturing WIM’s to locations other than the kbox (externally capturing)

This is the capture wim compliment to blog http://www.itninja.com/blog/view/wim-storage-k2000-version-3-7-freeing-up-space-on-your-k2000-if-you-are-using-wims-and-speed-up-deployment-using-network-windows-shares

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: http://www.itninja.com/blog/view/wim-storage-k2000-version-3-7-freeing-up-space-on-your-k2000-if-you-are-using-wims-and-speed-up-deployment-using-network-windows-shares

264mub.jpeg


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


'<head>
<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>
<HTA:APPLICATION
APPLICATIONNAME="ImageX Capture"
SCROLL="no"
SINGLEINSTANCE="yes"
>
</head>

<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
Else
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.")
Else
'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")
WshShell.run strCommand
'MsgBox("Process Complete. Check T:\imagestore\" & imgForm.imgName.value & ".log for errors" )
Set WshShell = nothing
End If
End Sub

</script>


<body>
<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/>
</div>

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

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


</body>

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

 HgkD6c.jpeg

Fill in the KBE information

 YPcbDb.jpeg

From the configure dropdown choose “Modify KBE Tools”

E7IDpJ.jpeg

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”

v5uOyT.jpeg

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

tvHkD9.jpeg

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

 FmA4tW.jpeg

 Say OK and Click create KBE:

----------------------------------------------------------------------------------------------------

Using the KBE you just created:

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

sLxw8s.jpeg

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

Generic Capture HTA

3wXsfP.jpeg

modified Capture HTA

AmJGWP.jpeg


Comments

  • Awesome tutorial. I've used your previous one to create my current custom KBE for pushing my images. It has saved a lot of time. I don't always remember imaging from the kbox being so slow, but now it pains me when I have to.

    I was curious to know if you've created/modified a KBE for UEFI images that capture the c: and s: drives. Is there some small tweak I can do to achieve at least pushing a UEFI image from an external location since it captures both drives in separate wims? - animerunt 9 years ago
    • just run the capture twice. Once for c and once for s and use two mid level deployment tasks to cast them back - SMal.tmcc 9 years ago
      • Well yeah if I want to do it the easy way. Isn't there a more convoluted/ridiculously more difficult way? J/k Thanks. - animerunt 9 years ago
  • I have modified the code to now work for DISM win 10 pe. - SMal.tmcc 8 years ago
This post is locked

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ