Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I currently use this simple batch-file to deploy an image to our workstations:

cd \
diskpart /s diskpartcmds.txt
imagex.exe /apply y:\image.wim 1 c:
bootsect /nt52 c:

(Y: is a mounted network share, dispkatcmds.txt is

select disk 0
create partition primary
select partition 1
format quick
assign letter=c


This works absolutely well, it runs in a console window after WinPE booted via PXE and shows progress. I would only like to have a nice GUI (just showing tasks and progress, no interaction!) that is shown instead of the console while the image is deployed with a progress bar.

Does someone have something already? Is there a complete .NET wrapper (I can use mono installed on Y:!) for ImageX?

Unfortunately there is only one article to be found about imagex.dll

Sorry for posting such a selfish lazy question about something purely cosmetic that I would probably be able to write if I had a lot of time), but I can try and maybe someone learns from this question about imagex?


locked by HopelessN00b Dec 5 '14 at 8:30

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

up vote 2 down vote accepted

Have a look at GImageX.

Thanks! Unfortunately no source code. But a COM-object with an easy apply-function and progress callback. Looks great, I'll try it – Christian May 11 '09 at 22:55

The Microsoft Deployment Toolkit 2008 Update 1 does all this and more. And it's free too! MDT 2008 will also solve a number other problems you might have.

MDT 2008 includes a mmc console, a customised WinPE build environment and many very useful scripts. From it's 'imagex' wrapper gui it can (via lite touch or zero touch, smb share, pxeboot or media):

  1. Inject new drivers
  2. Change the HAL
  3. Input a PC name and join the machine to a domain.
  4. Change the timezone and language details
  5. Change the local admin password
  6. Running Windows update (including running it against your own WSUS server)
  7. Install additional programs.

MDT 2008 can also:

  1. Inject new mass storage drivers
  2. Automate imagex build and captures
  3. Change customise deployments based on data inputted into database.
  4. Customise WinPE images
  5. Tons more that I'll get to listing.
Thanks, looks great! But I have solved many problems myself already (integration in Linux dns/dhcp/tftp-servers, database with computers, utility to join domain, set admin pw and rename computer). Unfortunately I could not find a wrapper for imagex, the script Microsoft Deployment Toolkit\Templates\Distribution\Scripts\LTIApply.wsf just executes imagex.exe. Were is that wrapper? The ability to inject drivers and mass storage drivers OFFLINE into XP (not Vista!) would of course be great, but a topic of its own. – Christian May 11 '09 at 22:52
MDT 2008 uses a concept called 'Task Sequences' to execute imagex. You can create a 'Task Sequence' in the MDT console. MDT will then generate a unique WinPE image which runs your desired 'task sequence'. The Task Seqence and the WinPE enviromment is very customiseable as you can remove all the functionality you don't need and add in all your custom scripts that you do need. Plus you get a nice loooking non-interactive progress bar with the custom background of your choice. – Dale Nicholls May 12 '09 at 0:38

There's a PowerShell script on MSDN whose source has examples of how to call into WIMGAPI APIs from C# or any other .NET language:

Perhaps that might be a useful example to you? (This particular script embeds C# code in it, loads the code using the PowerShell built-in Add-Path, and then calls into the C# code from the native PowerShell scripting.)

If you're looking for more of a function-by-function reference, MSDN does have official details about the publicly exposed APIs in wimgapi.dll:


Not the answer you're looking for? Browse other questions tagged or ask your own question.