|
本帖最后由 liuzhaoyzz 于 2021-3-29 07:45 编辑
有没有可能pecmd已经有解决办法了,只是因为参数太多,我不会用?
我尝试用devcon,可以成功。
@echo off
setlocal EnableDelayedExpansion
if /i %PROCESSOR_IDENTIFIER:~0,3%==x86 (
set "devcon=devcon.exe"
set "svbus=svbusx86"
set "PECMD=PECMDx86_cli.exe"
) else (
set "devcon=devcon64.exe"
set "svbus=svbusx64"
set "PECMD=PECMDx64_cli.exe"
)
reg import EVRootCA.reg
%devcon% status "root\%svbus%"|find /i "No matching devices found" 1>nul 2>nul && (
echo Install svbus driver...
%devcon% install svbus.inf "root\%svbus%"
echo Svbus driver has been installed.
)
%devcon% status "root\%svbus%"|find /i "The device has the following problem" 1>nul 2>nul && (
set /p confirm=警告:你的电脑需要重启下以确保svbus驱动生效!现在重启?(Y=是,回车或者N=不是):
if not defined confirm set confirm=N
if /i "!confirm!"=="Y" shutdown.exe /r /f /t 5 /c "重启电脑,以确保svbus驱动生效..."
)
pause
但是再次用devcon可能会导致一些问题,第二次用的话可能需要先删除驱动,但是删除驱动之后再次安装就会导致:
由于 Windows 无法加载这个设备所需的驱动程序,导致这个设备工作异常。 (代码 31)
对象名已存在。
这个“对象名已存在”,不知道指的是什么?我尝试sc delete "svbusx64"服务也没用。sc delete "svbusx64"会删除下面的svbus注册表服务:Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\svbusx64]
"Type"=dword:00000001
"Start"=dword:00000000
"ErrorControl"=dword:00000001
"Tag"=dword:00000022
"ImagePath"=hex(2):53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,\
72,00,69,00,76,00,65,00,72,00,73,00,5c,00,73,00,76,00,62,00,75,00,73,00,78,\
00,36,00,34,00,2e,00,73,00,79,00,73,00,00,00
"Group"="SCSI Miniport"
"Owners"=hex(7):6f,00,65,00,6d,00,31,00,34,00,2e,00,69,00,6e,00,66,00,00,00,00,\
00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\svbusx64\Enum]
"0"="ROOT\\SCSIADAPTER\\0000"
"Count"=dword:00000001
"NextInstance"=dword:00000001
%devcon% remove root\%svbus%执行之后,已经删除了注册表[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e97b-e325-11ce-bfc1-08002be10318}\0003]的这个主键,这是svbus驱动安装时创建的主键,怎么还会提示这个“对象名已存在”?搞不懂。
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e97b-e325-11ce-bfc1-08002be10318}\0003]
"DriverDesc"="SVBus Virtual SCSI Host Adapter"
"ProviderName"="Kai Schtrom"
"DriverDateData"=hex:00,80,c3,f5,ef,1c,d6,01
"DriverDate"="4-28-2020"
"DriverVersion"="1.2.0.0"
"InfPath"="oem14.inf"
"InfSection"="svbusx64"
"MatchingDeviceId"="root\\svbusx64"
windows事件查看器错误日志:设备 ROOT\SCSIADAPTER\0000 在启动时出现问题。
驱动程序名称: oem14.inf
类 GUID: {4d36e97b-e325-11ce-bfc1-08002be10318}
服务: svbusx64
低层筛选程序:
高层筛选程序:
问题: 0x1F
|
|