Jump to content

ImageX HTA with Win PE 3.0/4.0 x64/x86


Recommended Posts

Yes you can have multiple images in the same WIM file. I have not seen this type of behaviour before. Of course the first thing I do when I need to troubleshoot the HTA (or any custom program I put in there) is to open the command prompt and manually run the commands. This way we can see if it is a problem with the code or something else.

So in your case, on your server you want to get the image index value (makes things easier) and make note. So then in the command prompt in the HTA, you would do something like this:

diskpart /s diskpart.txt
diskpart /s misc/diskpart.txt

I have moved my file, but I think there is one in MISC still. Then:

imagex /apply z:\images\image.wim 2 c:

When it is done, do a reboot and see how it goes.

Alternatively, you could inspect the folders with Notepad after the normal deployment. NOTE: Notepad will only see *.txt files and it may appear these folders are empty until you change the type to All Files.

Link to comment
Share on other sites

  • 2 weeks later...

Got that working now thanks but I have moved on a step.

I am running all this in windows pe 3.0, the HTA file and storage.

When I try to run the create or append a new wim option I follow it and it says that the image has been created or appended but when I look into it a bit further or refresh the HTA there is nothing else added either file wise or to the appended image.

I ran the command manually in dos screen and it throws up an error about disk space. I have the new wim file or appending file on a 1TB USB hard drive formatted in NTFS and created via diskpart. There is 400GB left on the disk and the wim file is only about 5GB.

If I do it manually with GImagex to the same USB hard drive then the image creates OK or appends OK.

Any ideas ?



Edited by dicko1976
Link to comment
Share on other sites

I'm not sure about using a USB drive. In theory it should work. Make sure you are using the correct drive letters. In my HTA I have replaced the functions of the capture and append buttons because I did not want our regular technicians to have the ability of changing the images. All of my images are stored on a file share. I do all my capture/append/delete work using the command prompt button.

Oh I have also seen there are some instances where imagex does not like capturing and saving the WIM file to the same physical hard disk. I ran into this problem when trying to create recovery with WinPE 2 on netbooks for XP.

Link to comment
Share on other sites

Thanks for you response. The C: drive is where I am capturing the image and the usb is where the wim file is. If I do it via GimageX then it captures all OK.

I would like to use the HTA to capture and restore but if its not possible then it looks like GImageX. Just wanted a simpler screen for the engineers

Thanks again


Link to comment
Share on other sites

I have made a v7.2 which is available on SkyDrive

This version has both 32bit and 64bit support. It includes a very simple readme. It has the fixes to the Messageboxes that I made, and the XML fix that Dabone made. It also includes the two background images I had created. Let me know if you have any problems with it. I made it from my customized version that I run, so hopefully it works properly! I have not tested it.

Link to comment
Share on other sites

i first wanted to say thanks to everyone that worked on this hta, and for tripredacus for your time and taking this further. i have a few questions.

i have winpe 3.0 and just created a new win7 wim. i need to have our deskside techs use a thumbdrive to start upgrading users to windows 7.

do to the size limit on thumbdrives, do to the format, i have to split out .wim into .swm files.

i dont see any .swm file support within the code, is this correct, or something that i can add or change?

i also dont see a /apply function. in theory i would just like to have the deskside tech boot in winpe from the thumbdrive and be able to imagex /apply with new win7 .swm files onto the system.

im will to help if needed, just let me know!

thanks again for you help with this in advance.


Edited by surrealpro
Link to comment
Share on other sites

This HTA was designed to use WIM files, which is why you aren't seeing SWM files. I have little to no experience with SWM files other than the ones WDS creates by itself.

If you want to modify the code to work with SWM files, go right ahead. Of course I do not share my full HTA with everyone, just the generic base copy, so that's totally up to you.

Link to comment
Share on other sites

  • 5 weeks later...
  • 4 weeks later...

Moved some content from post 1 to post 2. Changed the intro to show as more of a project rather than just a support thread.

Added "development opportunities" which is basically just a list of things that have been requested, or that I wanted to change as well. A little note about some of these...

The App and Custom OS installer is something present in my version of the HTA, but is removed from the public version. Currently, my HTA has buttons (the mount/capture/append buttons) changed to install applications and deploy custom images such as Win7+WinRE, Server 2008 + WinRE, custom partition values with XP. These menus are hand-coded and I've recently come into a situation where I cannot easily maintain these menus anymore aka the actual server is no longer at my location. So I wanted to come up with a program that would look on the file share for a file, and that file would tell those menus what apps or images are available, and populate the menus appropriately.

This idea also ties in with the "local os detection", custom partition support/browse for diskpart script items as well.

If you have any other ideas or want to help out, feel free to post here!

Link to comment
Share on other sites

  • 2 months later...

I keep getting an error when adding my boot.wim to my wds. It keeps telling me that the file does not contain a valid boot image. I have followed the examples to a tee and even modified where appropriate for an x86 environment. All the configuration was done using waik. Any input would be greatly appreciated.

Edit:FIXED, my virtualization waas being screwy, however, do i want to add the winpe.wim or the boot.wim in the iso\sources directory?

It wont let me delete this post,but it's solved..still having resolution/button functionality issues though...

Edited by dwburkett
Link to comment
Share on other sites

The official instructions have you copy the winpe.wim into sources\boot.wim. So you have the "original" and untouched winpe.wim, and your production boot.wim. You could just skip that whole step and use the winpe.wim. It doesn't need to be called boot.wim either, you could call it bananas.wim and WDS isn't going to care.

Basically, if you did the xcopy winpe.wim sources\boot.wim, AND you mounted and modified the boot.wim, then you need to add that one.

Link to comment
Share on other sites

  • 2 months later...

Hi there and greetings from Portugal!

First of all, I would like to thank to everyone that made this fantastic solution possible!

It really helped me a lot!

Now...the 2 issues I still have!


After applying the image to a machine I always get 2 boot options (both named Windows 7), one works and continues the machine installation and the other do nothing (crashes to the usual boot manager menu).


It's there anyway with this processo to add an answer file when applying the image?

Best Regards,


Link to comment
Share on other sites

1. The only time I have seen two entries show up, its because there was an OS on the driver before and an image was applied overtop. For example, first boot after WinRE is run will do this, but the other option goes away after sysprep has run the first time. Are you doing multiple partition installs? I have noticed that the multiple partition option does not always assign the appropriate drive letters.

2. Unfortunately no. You can add an answer file directly into the image. All my images that use answer files have them in the image already.

Link to comment
Share on other sites

  • 2 months later...

HI there, thank you very much for this thread. But I am having some problem, I created the Boot.wim as specified. Now when I put my USB drive, it loads from the uSB drive and connect to the network successfully as well. But after that in IngegX hta there is nothing in selct file. I do have a dozon .wim file in server.

Also what I am trying to do is, I have wim files in server. I want to stick my USB driver in whatever computer I want and apply the wim file to that computer. So how do I do that any comment will be appreciated.

Thank you very much

Link to comment
Share on other sites

If you are getting the browse box after the PE boots, its because there is something up with your NIC. Either you can't get an IP or the NIC drivers are not installed.

Open a CMD and verify you have an IP and can access the mapped network drive. Otherwise you'll need to use DISM to put your NIC drivers in the boot.wim.

Also, in the imagex.hta, on line 25 is a "myFilePath" which is what you want to match against the map driver command in your startnet.cmd. For example, mine says:

myFilePath = "Z:\"						                            'The folder that contains the *.wim files add "\" to the end of the path.

Edited by Tripredacus
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

  • Create New...