Computer issue, not WoW related

Since there seems to be alot of computer expertise in the guild, I figured that I would ask here.

Over the past 2-3 years or so, I have been working on a AIO (All In One) installation DVD for Windows XP. This is basically an unattended setup. The intent is to boot off the DVD and walk away from the computer. Come back a few hours later and you have a complete computer system will all the software, patches, and updates installed. If you want to know more about this, then head on over to unattended.msfn.org and take a look. My user name there is Maelstorm.

I'm using CDShell to make the boot menu for the DVD. There you select what type of install that you want, and then things happen. Also on this I have harddisk utilities, a wipe CMOS utility, memtest86 (google it), and other stuff. Now the problem is that the way that I'm doing it right now the entire first harddisk is repartitioned and reformatted by the Windows system setup program. Any data or partitions that are on that disk are summarily deleted.

What I want to do is create a hidden partition (Like the OEM System Restore partitions on name brand computers such as HP, Compaq, Dell, Gateway, etc) so I can copy the DVD over to it and use it as a system restore. I have seen suggestions of booting into Windows PE, running diskpart with a script to make the partitions, then running WINNT32.EXE with the approperiate command-line parameters to kick off the windows installation. The problem with this is that computers have harddisks of different sizes, and you can't do math in a cmd script.

Here's a few examples:

EX 1:

Disk 1: 120GB
Partition 1 (C): 100GB
Partition 2 (D): 20GB

EX 2:

Disk 1: 200GB
Partition 1 (C): 180GB
Partition 2 (D): 20GB

EX 3:

Disk 1: 340GB
Partition 1 (C): 320GB
Partition 2 (D): 20GB

Basically, partition 2 is set at a fixed size at the end of variable size parition 1, which is the rest of the disk. I'm quite certain that there's a way to do this automatically, but I don't know how.

So, does anyone have any idea on how to pull something like this off?