pnputil 명령어를 활용하여 윈도우에서 드라이버를 백업하고 복구하는 방법을 설명드립니다. 이 방법은 윈도우 설치 시 유용하게 활용될 수 있습니다.
1. 드라이버 백업: 다음 명령어를 사용하여 시스템의 모든 드라이버를 백업할 수 있습니다: pnputil /export-driver * C:\DriverBackup 위 명령어는 시스템에 설치된 모든 드라이버를 C:\DriverBackup 폴더로 백업합니다.
2. 드라이버 복구 (설치): 백업된 드라이버를 복구하려면 다음 명령어를 사용합니다: pnputil /add-driver C:\DriverBackup\*.inf /subdirs /install 이 명령어는 C:\DriverBackup 폴더에 있는 .inf 파일을 사용하여 드라이버를 설치합니다. /subdirs 옵션은 하위 폴더에 있는 드라이버도 함께 처리하도록 합니다.
3. 드라이버 설치 후 재부팅: 드라이버 설치 후 자동으로 재부팅하려면 /reboot 옵션을 추가할 수 있습니다: pnputil /add-driver C:\DriverBackup\*.inf /subdirs /install /reboot 위 명령어는 드라이버 설치 후 자동으로 시스템을 재부팅합니다.
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous>
<!-- x64 WanDrv7 런처(EDLauncher.bat 배치 파일이 있으면 실행하고 없으면 종료) -->
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>cmd.exe /c if exist "%Windir%\Setup\Scripts\EDLauncher.bat" "%Windir%\Setup\Scripts\EDLauncher.bat"</Path>
<Description>Auto Driver Launcher</Description>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- OOBE 무인 설정(자동화) -->
<OOBE>
<!-- Windows 시작의 Microsoft 소프트웨어 사용 조건 페이지를 숨길지 여부를 지정합니다. -->
<HideEULAPage>true</HideEULAPage>
<!-- Windows 시작 중에 나타나는 무선 네트워크 연결 화면을 숨길지 여부를 지정합니다. -->
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<!-- 사용자가 처음 로그온할 때 컴퓨터가 네트워크에 연결된 경우 네트워크의 위치를 지정합니다. -->
<NetworkLocation>Work</NetworkLocation>
<!-- 중요하고 권장되는 업데이트가 자동으로 설치되도록 지정합니다. -->
<ProtectYourPC>3</ProtectYourPC>
<SkipMachineOOBE>true</SkipMachineOOBE>
<SkipUserOOBE>true</SkipUserOOBE>
</OOBE>
<!-- 관리자(Administrator) 계정으로 자동 로그인 -->
<AutoLogon>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>Administrator</Username>
</AutoLogon>
<!-- 사용자가 컴퓨터에 처음으로 로그온할 때 실행할 명령을 지정합니다. -->
<FirstLogonCommands>
<!-- C:\Install_Drv 경로가 있으면 드라이버를 설치 하고 없으면 패스 -->
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<CommandLine>cmd.exe /c if exist "C:\Install_Drv" pnputil /add-driver C:\Install_Drv\*.inf /subdirs /install</CommandLine>
<Description>Install Drivers</Description>
</SynchronousCommand>
<!-- RunOnce 바탕화면 진입 시 1회 실행 할 항목 등록, C:\Install_Drv 폴더가 있으면 바탕화면 진입 시 삭제 등록 없으면 패스 -->
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<CommandLine>cmd.exe /c if exist "C:\Install_Drv" reg add HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce /v DeleteInstallDrv /t REG_SZ /d "cmd.exe /c rd /s /q C:\Install_Drv" /f</CommandLine>
<Description>Delete Install_Drv Folder</Description>
</SynchronousCommand>
</FirstLogonCommands>
<!-- 해상도 설정 -->
<Display>
<HorizontalResolution>1920</HorizontalResolution>
<VerticalResolution>1080</VerticalResolution>
<ColorDepth>32</ColorDepth>
</Display>
</component>
</settings>
<cpi:offlineImage cpi:source="" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
EasyWinSetup v0.8.7.3으로 업데이트되면서 Drv 위치 지정 옵션이 추가되어 확인차 윈도우7 드라이버를 백업하여 설치해 보았습니다. boot.wim pe 환경에서 Drv 위치 팝업창이 열리진 않았지만, 경로를 직접 지정하였더니 기능상에 문제없이 잘 설치되었습니다. 윈도우 설치 시 Drv 위치를 지정하여 활용해 보시기 바랍니다.