Attaching answer file to sysprep

Cloning Windows 7 is very confusing!

I've read most of (v=ws.10).aspx and it's sub-topics, but I can't figure it out.

When I run the sysprep, it strips the custom drivers out?

Apparently, I am supposed to create an answer file which contains the following:

<settings pass="generalize"> <component name="Microsoft-Windows-PnpSysprep"> <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls> </component>

What I can't figure out is how to attach this answer file to sysprep?

Or am I supposed to run sysprep, let it strip out all the drivers, then use windows aik to re-attach the drivers? I can't figure out the correct sequence from the microsoft help files.

3 Answers

The file is actually an "Unattended Install Answer File".

Take a look at this MS Article: Sysprep Command-Line Syntax.

Specifically the Sysprep option "/unattend answerfile":

/unattend
Applies settings in an answer file to Windows during unattended installation.

answerfile
Specifies the path and file name of the answer file to use.

I know this is an old post but if anyone ever needs to create an win7 image w/ all drivers quickly w/o installing AIK, here is what you can do,

  1. Install all software and drivers you need
  2. Go to registry

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Sysprep\Settings\sppnp

    and change PersistAllDeviceInstalls to 1

  3. Run sysprep sysprep.exe /oobe /generalize

When you run sysprep with generalize option, then your OS is not assigned to hardware which it was installed on, but it keeps all drivers in driver store. When you run that OS after sysprep, it installs those drivers again. When you use an answer file with PersistAllDeviceInstalls option, it doesn't uninstall any drivers, so it doesn't have to install them again. So you use that option if you plan to deploy your image to the same hardware (the same computer or the same model with identical devices inside).

Run: C:\Windows\System32\sysprep\sysprep.exe /generalize /oobe /shutdown /unattend:<filename>

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like