I am working on creating software to work with Windows PE in order to automate the processes that somebody would normally have to do when formatting a drive and reinstalling Windows. I am starting this project to be compatible with both Windows 7 and 8, but it is expected to also be compatible with Vista.
I programmed an algorithm with the help of somebody else a while back that converts/decodes the Product Key associated with the current running installation of Windows from the "DigitalProductId" registry value inside the Windows Registry. I was just looking around at the registry and filesystem and realized that drivers could be backed up actually quite easily.
First, open the registry. Enumerate through "HKLM\System\ControlSet001\Enum" and subkeys; Any value that exists as "HKLM\System\ControlSet001\Enum\**\**\Service" Gets referenced through "HKLM\System\ControlSet001\services\[Service Value]", then that key's values "DriverPackageId" and "Displayname" can be used in the program that wants to backup the driver files. The correct driver files would be in the location as follows: "%windir%\System32\DriverStore\FileRepository\[DriverPackageId]". Activation files are also easy to backup and restore.
Utilizing WinPE and this method correctly, one should be able to create a disc to automatically format/reinstall windows on a computer with all of the product key, drivers, activation already taken care of. Can any other experts on this subject offer any insight on this?