Jump to content

Deploying XP with PE 2.0 and Custom HTA


WreX

Recommended Posts

I'm embarking on a project to replace our custom DOS-based system for deploying Windows with PE 2.0. BDD 2007 cannot accomplish everything we need, so I'd like to write all the scripts myself in HTA. I'll list my current issue first, and then everything I'd like to accomplish...

Here's the issue

I created a bootable PE 2.0 CD using the latest WAIK and installed all packages. After booting to the command prompt, I simply want to run an HTA that displays a window with "Hello world". If I just type "test.hta", it wants a file association. I find mshta.exe in some cryptic folder under X:\Windows\winsxs\..., so I copy that to X:\Windows\System32 and attempt "mshta.exe test.hta" with all forms of full paths and the like, but it just returns to the prompt and displays nothing. What do I have to do to manually run an HTA?

What I'd like to accomplish

  • Boot a PE CD without requiring "Press any key"
  • Launch an HTA from startnet.cmd
  • Install a bootable PE on C:
  • Install XP Pro on D: with a WIM
  • Provide a boot menu to choose between XP and PE

Is any of this impossible? Would anyone be kind enough to offer some tips? Any help would be greatly appreciated.

Now if I could just get the stupid HTA to run I'd feel like I'd won half the battle...

Link to comment
Share on other sites


In my experience, I've found that you have to use the full path to the hta file for it to launch. Additionally, you shouldn't need to move mshta.exe as I just call it from anywhere (i.e. - mshta.exe X:\Windows\system32\wizard.hta).

You can disable the "Press any key..." functionality by removing bootfix.bin from the boot folder of your CD.

You can add a boot menu using bcdedit to modify your bcd and placing that on your boot partition. Just search for bcd and bcdedit to learn more.

Link to comment
Share on other sites

I'm using a similar setup at my office.

When you're creating you PE 2.0 CD, you have to add both the WinPE-HTA-Package as well as the WinPE-XML-Package for HTAs to work.

Everything else on you list of things to include should be pretty straight forward and easily doable.

Link to comment
Share on other sites

Ok, I think I was using a bum CD because I created a new one by using the instructions in WINPE.CHM for "Walkthrough: Create a Custom Windows PE Image" step-by-step using "peimg /install=*" and now HTAs work like a champ. I think maybe the "peimg /prep" command might've been missed on that first CD as mshta.exe is now in X:\Windows\System32\ instead of that crazy X:\Windows\winsxs\... folder.

Here's another question: In regards to placing a bootable PE partition on the hard drive. Does anyone have experience with password protecting PE? Is there any kind of built-in way to require a password to either boot or get into it? I'm guessing I'll have to add something to either startnet.cmd or my own HTA to accomplish this.

Link to comment
Share on other sites

I have not found anything to password protect PE other than creating you own application. If you find something let us know but this has come up numerous times over the years and there has never been a good solution.

Link to comment
Share on other sites

On our systems we hide the PE partition and unless they're admins the users cannot unhide it and boot from it.

Not password protected, but effective in our environment.

What do you use for a boot manager when you need to boot from PE?

Link to comment
Share on other sites

We just use a simple batch file that uses GDISK to unhide and then activate the WinPE partition. It then issues are reboot and the system boots up into WinPE. While in PE, if you want to reboot back into XP, (we have an HTA front end) we have a script that reverses the process. It hides the WinPE partition, activates the original XP partitoin, and reboots.

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...