LoginSignup
5
4

Windows7以上でデバイスドライバー消さずに簡易的にsysprepを行う方法

Last updated at Posted at 2017-04-10

Windows7以降、デフォルトのままsysprepを実行するとインストールしたデバイスドライバーがすべて消されてしまうという設定になっています。
それを防ぐため、sysprepを行う際にデバイスドライバーを消さずにsysprepを行いマシンをシャットダウンする方法をメモしておきます。

##対応OS(確認済みOS)
基本、Windows7以上であれば、どのWindows(サーバーOSを含む)で対応可能なはずです。
 

対応OS
Windows7
Windows8
Windows8.1
Windows 10 1607 ~ 21H1
Windows Server 2008 R2
Windows Server 2012 R2
Windows Server 2016
Windows Server 2019
Windows Server 2022

sysprepを行いたいPCの中で以下を作業します。

以下の内容を書いたファイルを「C:\unattend.xml」として保存します。(保存場所は任意)

<unattend>
<settings pass="generalize">
	<component name="Microsoft-Windows-PnpSysprep" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
		<PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
	</component>
</settings>
</unattend>

以下の内容を記入したSysprep実行用のバッチファイルを「c:\sysprep.bat」として保存します。(保存場所は任意)

C:\windows\system32\sysprep\sysprep /generalize /oobe /reboot /unattend:c:\unattend.xml /mode:vm
  1. 尚、上記のunattend.xmlファイルは保存したパスを入れてください。
  2. /mode:vmは、Windows8(Windows Server 2012)以降でないと利用できません。Windows 7等の場合は、このパラメーターは削除してください。

##sysprepの実行方法
sysprepの準備ができたら、sysprep.batを実行するだけです。

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4