mirror of
https://github.com/bin456789/reinstall.git
synced 2026-10-03 22:17:46 +08:00
windows: 优先使用用户添加的驱动
This commit is contained in:
+13
-10
@@ -21,7 +21,19 @@ rem https://learn.microsoft.com/windows-hardware/manufacture/desktop/capture-and
|
|||||||
rem win8 pe 没有 powercfg
|
rem win8 pe 没有 powercfg
|
||||||
powercfg /s SCHEME_MIN 2>nul
|
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\ (
|
if exist X:\drivers\ (
|
||||||
for /f "delims=" %%F in ('dir /s /b "X:\drivers\*.inf" 2^>nul') do (
|
for /f "delims=" %%F in ('dir /s /b "X:\drivers\*.inf" 2^>nul') do (
|
||||||
call :drvload_if_scsi "%%~F"
|
call :drvload_if_scsi "%%~F"
|
||||||
@@ -37,15 +49,6 @@ if exist X:\drivers\ (
|
|||||||
rem )
|
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 等待加载分区
|
rem 等待加载分区
|
||||||
call :sleep 5000
|
call :sleep 5000
|
||||||
echo rescan | diskpart
|
echo rescan | diskpart
|
||||||
|
|||||||
+2
-2
@@ -52,10 +52,10 @@
|
|||||||
<!-- 目录为空不会报错 -->
|
<!-- 目录为空不会报错 -->
|
||||||
<!-- 驱动可以放在子目录 -->
|
<!-- 驱动可以放在子目录 -->
|
||||||
<PathAndCredentials wcm:action="add" wcm:keyValue="1">
|
<PathAndCredentials wcm:action="add" wcm:keyValue="1">
|
||||||
<Path>X:\drivers</Path>
|
<Path>X:\custom_drivers</Path>
|
||||||
</PathAndCredentials>
|
</PathAndCredentials>
|
||||||
<PathAndCredentials wcm:action="add" wcm:keyValue="2">
|
<PathAndCredentials wcm:action="add" wcm:keyValue="2">
|
||||||
<Path>X:\custom_drivers</Path>
|
<Path>X:\drivers</Path>
|
||||||
</PathAndCredentials>
|
</PathAndCredentials>
|
||||||
</DriverPaths>
|
</DriverPaths>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
Reference in New Issue
Block a user