0

我正在尝试使用 Windows PE 自动安装驱动程序。启动 PE 并查找设备后,我得到这样的输出:

devcon status *pci*
PCI\VEN_8086&DEV_0C05&SUBSYS_11F41734&REV_06\3&11583659&0&09
    Name: PCI standard PCI-to-PCI bridge
    Driver is running.
PCI\VEN_19A2&DEV_0800&SUBSYS_11CC1734&REV_00\4&313340F4&0&01E0
    Name: Coprocessor
    The device has the following problem: 28

现在,我只对有错误/问题的设备感兴趣。

如何确定哪些设备受到影响?

我用 findstr 试过了:

devcon status *pci* | findstr /n /i "pci\\ name problem"

但我总是得到所有设备,而不仅仅是有故障的设备。

最简单的方法似乎是使用文件

devcon status *pci* > devcon.txt
findstr /n /i "problem" devcon.txt

有了这个,我得到了行号。但是我现在如何阅读包含“问题”的行上方的第 2 行?

4

1 回答 1

0

所以,经过一天的研究,我可以回答自己的问题;)

解决这个问题最简单的方法是 linux grep(来自 cygwin64)

我已经安装了 cygwin 并将这些文件复制到 pe

  • grep.exe
  • cygiconv-2.dll
  • cygintl-8.dll
  • cygpcre-1.dll
  • cygwin1.dll

我的命令行现在看起来像这样

devcon 状态 *pci * | grep -B2 -i -e 问题 -e 停止 > errors.txt

也许我可以缩短这个命令,但我很高兴那是有效的。

网主

于 2014-08-21T06:27:56.953 回答