欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

使用命令行安装驱动程序的方法

程序员文章站 2022-05-28 10:43:47
使用命令行安装驱动程序的方法...
看了一下celluar emulator的内容,除了应用程序,还需要安装一个虚拟硬件的驱动,名为xpvcom。安装完毕后,会出现一个xpvcom port。这个虚拟硬件将接受device emulator的at指令,模仿手机的相应功能。

    很简单,安装这个虚拟硬件的驱动即可。查找驱动然后定位到xpvcom.inf。问题在于我想把这些工作打包,全部自动执行,不用点来点去。想起了以前解决osd的acpi问题时用的工具,devcon。

    devcon是设备管理器的命令行版本,可以查看其帮助:

c:\users\hhu\desktop\wme\drivers>devcon /?
device console help:
devcon [-r] [-m:\\<machine>] <command> [<arg>...]
-r if specified will reboot machine after command is complete, if needed.
<machine> is name of target machine.
<command> is command to perform (see below).
<arg>... is one or more arguments if required by command.
for help on a specific command, type: devcon help <command>
classfilter          allows modification of class filters.
classes              list all device setup classes.
disable              disable devices that match the specific hardware or instanc
e id.
driverfiles          list driver files installed for devices.
drivernodes          lists all the driver nodes of devices.
enable               enable devices that match the specific hardware or instance
id.
find                 find devices that match the specific hardware or instance i
d.
findall              find devices including those that are not present.
help                 display this information.
hwids                lists hardware id's of devices.
install              manually install a device.
listclass            list all devices for a setup class.
reboot               reboot local machine.
remove               remove devices that match the specific hardware or instance
id.
rescan               scan for new hardware.
resources            lists hardware resources of devices.
restart              restart devices that match the specific hardware or instanc
e id.
sethwid              modify hardware id's of listed root-enumerated devices.
stack                lists expected driver stack of devices.
status               list running status of devices.
update               manually update a device.
updateni             manually update a device (non interactive).

    为了安装这个虚拟硬件,只需要运行以下命令行:

devcon install xpvcom.inf "root\xpvcom"
devcon rescan

    你要问“root\xpvcom”设备描述符哪里来的?打开inf文件就能看到

……

[standard]
;
;

%xpvcom.devicedesc%=xpvcom_device, root\xpvcom
……

    命令行安装一个驱动,就这么简单。