From 94c9ff84b9a3537494ff322a6fc0c1d912e895c9 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Thu, 10 Sep 2026 01:06:52 +0800 Subject: [PATCH] =?UTF-8?q?windows:=20=E4=BC=98=E5=85=88=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B7=BB=E5=8A=A0=E7=9A=84=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- windows-setup.bat | 23 +++++++++++++---------- windows.xml | 4 ++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/windows-setup.bat b/windows-setup.bat index 97b98f2..c15ff37 100644 --- a/windows-setup.bat +++ b/windows-setup.bat @@ -21,7 +21,19 @@ rem https://learn.microsoft.com/windows-hardware/manufacture/desktop/capture-and rem win8 pe 没有 powercfg powercfg /s SCHEME_MIN 2>nul -rem 安装 SCSI 驱动 +rem 两个同样的驱动,PE 下只会使用先加载的那个 +rem https://learn.microsoft.com/troubleshoot/windows-client/setup-upgrade-and-drivers/limitations-dollar-sign-winpedriver-dollar-sign + +rem 因此先安装用户添加的 SCSI 驱动 +rem 可以用 forfiles /p X:\custom_drivers /m *.inf /c "cmd /c echo @path" +rem 不可以用 for %%F in ("X:\custom_drivers\*\*.inf") +if exist X:\custom_drivers\ ( + for /f "delims=" %%F in ('dir /s /b "X:\custom_drivers\*.inf" 2^>nul') do ( + call :drvload_if_scsi "%%~F" + ) +) + +rem 后安装脚本自动添加的 SCSI 驱动 if exist X:\drivers\ ( for /f "delims=" %%F in ('dir /s /b "X:\drivers\*.inf" 2^>nul') do ( call :drvload_if_scsi "%%~F" @@ -37,15 +49,6 @@ if exist X:\drivers\ ( rem ) ) -rem 安装自定义 SCSI 驱动 -rem 可以用 forfiles /p X:\custom_drivers /m *.inf /c "cmd /c echo @path" -rem 不可以用 for %%F in ("X:\custom_drivers\*\*.inf") -if exist X:\custom_drivers\ ( - for /f "delims=" %%F in ('dir /s /b "X:\custom_drivers\*.inf" 2^>nul') do ( - call :drvload_if_scsi "%%~F" - ) -) - rem 等待加载分区 call :sleep 5000 echo rescan | diskpart diff --git a/windows.xml b/windows.xml index 66cd610..c58421f 100644 --- a/windows.xml +++ b/windows.xml @@ -52,10 +52,10 @@ - X:\drivers + X:\custom_drivers - X:\custom_drivers + X:\drivers