remove and reinstall *all* drivers

You can use sysprep tool for that. Just run it from c:\windows\system32\sysprep\sysprep.exe, check Generalize and hit OK


Removing ALL drivers will damage windows and make your life horrible! Your are better off selectively removing the drivers.

Boot from Windows 7 DVD Select Repair and command prompt

If instead of a wim file your working with an offline copy of windows substitute the path that has the windows folder on it for c:\test\offline. When in the command prompt mode from the windows 7 DVD your drive letter may not be the same. Also with an offline copy of windows dism /Mount-Image maybe skipped.

This is all that is require on a offline version of windows.

Dism /Image:C:\ /Get-Drivers 

Lists all drivers

Dism /Image:C:\test\offline /Get-Drivers 

feed the list one at a time into the remove command below. It is only necessary to mount once, not once per driver.

You create an empty folder called test and within that another empty folder called offline. The wim file will be mounted to that folder.

Dism /Mount-Image /ImageFile:C:\test\images\install.wim /Name:"Windows 7 HomeBasic" /MountDir:C:\test\offline

Remove a specific driver from the image. Multiple drivers can be removed on one command line. For example, type:

Dism /Image:C:\test\offline /Remove-Driver /Driver:OEM1.inf /Driver:OEM2.inf

Removing a boot-critical driver package can make the offline Windows image unbootable

Adding drivers also has a command

Dism /Image:C:\test\offline /Add-Driver /Driver:C:\drivers\mydriver.inf /ForceUnsigned

Dism /Image:C:\test\offline /Add-Driver /Driver:c:\drivers /Recurse