Download Devcon.exe und Beispiele original auf: http://support.microsoft.com/kb/311272/de

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 instance 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 ID.
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 instance 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).

Beispiele            Befehlsbeispiele für einige der Befehle


devcon classfilter <class> upper <subcmds> - Upper filters.
devcon classfilter <class> lower <subcmds> - Lower filters.


Modifies upper and lower filters for a device setup class.
Changes do not take effect until the effected devices are restarted or the machine is rebooted.

Where <subcmds> iterate the list of services, modifying the services in the filter.
In the context of this command, each sub-command works on services in the list relative to
previous sub-commands. Examples below.

=     - move back to start of list of services (no "current" service). This is
        assumed prior to the first sub-command.
@svc  - move forward to specified service and treat it as "current" for the next
        sub-command.
!svc  - delete instance of specified service that's after "current" service.
        The place where the deleted service was is now considered the "current"
        service, making '-' and '+' behave exactly the same.
-svc  - insert service before current service (or beginning if none). Inserted
        service becomes new current service.
+svc  - insert service after current service (or end if none). Inserted service
        becomes new current service.

Examples:

If upperfilters of setup class "foo" is A,B,C,B,D,B,E:
devcon classfilter foo upper @D !B  - delete the 3rd 'B'.
devcon classfilter foo upper !B !B !B - delete all 3 instances of 'B'.
devcon classfilter foo upper =!B =!A  - delete first 'B' and first 'A'.
devcon classfilter foo upper !C +CC   - replaces 'C' with 'CC'.
devcon classfilter foo upper @D -CC   - inserts 'CC' before 'D'.
devcon classfilter foo upper @D +CC   - inserts 'CC' after 'D'.
devcon classfilter foo upper -CC      - inserts 'CC' before 'A'.
devcon classfilter foo upper +CC      - inserts 'CC' after 'E'.
devcon classfilter foo upper @D +X +Y - inserts 'X' after 'D' and 'Y' after 'X'.
devcon classfilter foo upper @D -X -Y - inserts 'X' before 'D' and 'Y' before 'X'.
devcon classfilter foo upper @D -X +Y - inserts 'X' before 'D' and 'Y' between 'X' and 'D'.

<top>

devcon [-m:\\<machine>] classes

List all device setup classes.
This command will work for a remote machine.
Classes are listed as <name>: <descr>
where <name> is the class name and <descr> is the class description.

<top>

devcon [-r] disable <id> [<id>...]
devcon [-r] disable =<class> [<id>...]

Disable devices that match the specific hardware or instance ID.
This command will only work for local machine.
Specify -r to reboot automatically if needed.

Examples of <id> are:

*                  - All devices (not recommended)
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.
Devices are disabled if possible.

<top>

devcon driverfiles <id> [<id>...]
devcon driverfiles =<class> [<id>...]

Lists driver files installed for devices that match the specific hardware or instance ID.
This command will only work for local machine.

Examples of <id> are:

*                  - All devices
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.

<top>

devcon drivernodes <id> [<id>...]
devcon drivernodes =<class> [<id>...]

Lists driver nodes for devices that match the specific hardware or instance ID.
This command will only work for local machine.

Examples of <id> are:

*                  - All devices
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.

<top>

devcon [-r] enable <id> [<id>...]
devcon [-r] enable =<class> [<id>...]


Enable devices that match the specific hardware or instance ID.
This command will only work for local machine.
Specify -r to reboot automatically if needed.

Examples of <id> are:

*                  - All devices (not recommended)
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.
Devices are enabled if possible.

<top>

devcon [-m:\\<machine>] find <id> [<id>...]
devcon [-m:\\<machine>] find =<class> [<id>...]


Find devices that match the specific hardware or instance ID.
This command will work for a remote machine.

Examples of <id> are:

*                  - All devices
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.
Devices are listed as <instance>: <descr>
where <instance> is the unique instance of the device and <descr> is the description.

<top>

devcon [-m:\\<machine>] findall <id> [<id>...]
devcon [-m:\\<machine>] findall =<class> [<id>...]


Find devices that match the specific hardware or instance ID, including those that are not present.
This command will work for a remote machine.

Examples of <id> are:

*                  - All devices
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.
Devices are listed as <instance>: <descr>
where <instance> is the unique instance of the device and <descr> is the description.

<top>

devcon [-m:\\<machine>] hwids <id> [<id>...]
devcon [-m:\\<machine>] hwids =<class> [<id>...]

Lists all hardware ID's of devices that match the specific hardware or instance ID.
This command will work for a remote machine.

Examples of <id> are:

*                  - All devices
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.

<top>

devcon [-r] install <inf> <hwid>

Manually installs a device.
This command will only work for local machine.
Specify -r to reboot automatically if needed.

<inf> is an INF to use to install the device.
<hwid> is a hardware ID to apply to the device.

<top>

devcon [-m:\\<machine>] listclass <class> [<class>...]

List all devices for specific setup classes.
This command will work for a remote machine.

<class> is the class name as obtained from the classes command.

Devices are listed as <instance>: <descr>
where <instance> is the unique instance of the device and <descr> is the description.

<top>

devcon reboot

Reboot local machine indicating planned hardware install.

<top>

devcon [-r] remove <id> [<id>...]
devcon [-r] remove =<class> [<id>...]

Remove devices that match the specific hardware or instance ID.
This command will only work for local machine.
Specify -r to reboot automatically if needed.

Examples of <id> are:

*                  - All devices (not recommended)
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.

<top>

devcon [-m:\\<machine>] rescan

Tell plug&play to scan for new hardware.

<top>

devcon [-m:\\<machine>] resources <id> [<id>...]
devcon [-m:\\<machine>] resources =<class> [<id>...]

Lists hardware resources of devices that match the specific hardware or instance ID.
This command will work for a remote machine.

Examples of <id> are:

*                  - All devices
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.

<top>

devcon [-r] restart <id> [<id>...]
devcon [-r] restart =<class> [<id>...]


Restarts devices that match the specific hardware or instance ID.
This command will only work for local machine.
Specify -r to reboot automatically if needed.

Examples of <id> are:

*                  - All devices (not recommended)
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.
Devices are restarted if possible.

<top>

devcon [-m:\\<machine>] sethwid <id> [<id>...] := <subcmds>
devcon [-m:\\<machine>] sethwid =<class> [<id>...] := <subcmds>

Modifies the hardware ID's of the listed devices. This command will only work for root-enumerated devices.
This command will work for a remote machine.

Examples of <id> are:

*                  - All devices (not recommended)
ISAPNP\PNP0601     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ROOT\*\*          - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.
<subcmds> consists of one or more:

=hwid              - Clear hardware ID list and set it to hwid.
+hwid              - Add or move hardware ID to head of list (better match).
-hwid              - Add or move hardware ID to end of list (worse match).
!hwid              - Remove hardware ID from list.
hwid               - each additional hardware id is inserted after the previous.

<top>

devcon [-m:\\<machine>] stack <id> [<id>...]
devcon [-m:\\<machine>] stack =<class> [<id>...]

Lists expected driver stack of devices that match the specific hardware or instance ID.

<top>

devcon [-m:\\<machine>] status <id> [<id>...]
devcon [-m:\\<machine>] status =<class> [<id>...]

Lists running status of devices that match the specific hardware or instance ID.
This command will work for a remote machine.

Examples of <id> are:

*                  - All devices
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)

<class> is a setup class name as obtained from the classes command.

<top>

devcon [-r] update <inf> <hwid>

Update drivers for devices.
This command will only work for local machine.
Specify -r to reboot automatically if needed.

<inf> is an INF to use to install the device.
All devices that match <hwid> are updated.

<top>

devcon [-r] updateni <inf> <hwid>

Update drivers for devices (Non Interactive).
This command will only work for local machine.
Specify -r to reboot automatically if needed.

<inf> is an INF to use to install the device.
All devices that match <hwid> are updated.
Unsigned installs will fail. No UI will be
presented.

<top>


DevCon-Beispielbefehle

devcon -m:\\test find pci\*

Anzeigen aller bekannten PCI-Geräte auf dem Computer test.
(Mit der Option -m können Sie einen Zielcomputer angeben.
Der Zugriff auf den Computer muss über IPC
(Inter Process Communication, prozessübergreifende Kommunikation) erfolgen.)


devcon -r install %WINDIR%\Inf\Netloop.inf *MSLOOP

Installieren einer neuen Instanz des Microsoft Loopbackadapters.
Erstellt einen Geräteknoten auf der Stammebene, in dem ein "virtuelles Gerät" installiert werden kann, z. B. der Loopbackadapter. Mit diesem Befehl wird außerdem der Computer ohne weitere Benachrichtigung neu gestartet, sofern dies erforderlich ist.


devcon classes

Anzeigen aller bekannten Setupklassen. Die Ausgabe enthält die nicht lokalisierte Kurzbezeichnung
(z. B. "USB") und die längere Bezeichnung (z. B. "USB-Controller").


devcon classfilter upper !filter1 !filter2

Löschen der beiden angegebenen Filter.


devcon classfilter lower !filter_alt +filter_neu

Ersetzen des Filters "filter_alt" durch den Filter "filter_neu".


devcon driverfiles =ports

Anzeigen von Dateien, die jeweils mit den in der Setupklasse ports (Anschlüsse) enthaltenen Geräten verknüpft sind.


devcon disable *MSLOOP

Deaktivieren aller Geräte, deren Hardware-ID auf "MSLOOP" endet (einschließlich "*MSLOOP").


devcon drivernodes @ROOT\PCI_HAL\PNP0A03

Anzeigen aller kompatiblen Treiber für das Gerät ROOT\PCI_HAL\PNP0A03.
Mit diesem Befehl lässt sich feststellen, warum eine in Windows enthaltene Datei mit Geräteinformationen (".inf") verwendet wurde, und keine Geräteinformationsdatei eines Drittanbieters.


devcon enable '*MSLOOP

Aktivieren aller Geräte mit der Hardware-ID "*MSLOOP". Die Anführungszeichen bedeuten, dass die Hardware-ID wörtlich angegeben wird, d. h. bei "*" handelt es sich wirklich um dieses Zeichen, und nicht um ein Platzhalterzeichen.


devcon find *

Anzeigen der Geräteinstanzen aller Geräte , die auf dem lokalen Computer vorhanden sind.


devcon find pci\*

Anzeigen aller bekannten PCI-Geräte (Peripheral Component Interconnect), die auf dem lokalen Computer vorhanden sind (dieser Befehl behandelt standardmäßig alle Geräte als PCI-Geräte, deren Hardware-ID mit "PCI\" beginnt).


devcon find =ports *pnp*

Anzeigen aller vorhandenen Geräte, die zur Setupklasse ports (Anschlüsse) gehören und deren Hardware-ID die Zeichenfolge "PNP" enthält.


devcon find =ports @root\*

Anzeigen aller vorhandenen Geräte, die zur Setupklasse ports (Anschlüsse) gehören und der Stammebene im Aufzählungsbaum zugeordnet sind (d. h. deren Instanz-ID mit der Zeichenfolge "root\" beginnt). Beachten Sie, dass Sie beim Programmieren keine Annahmen darüber machen sollten, wie eine Instanz-ID formatiert ist. Zum Ermitteln von Geräten in der Stammebene können Sie die Gerätestatusbits verwenden.
Dieses Feature ist in DevCon enthalten, um Ihnen beim Debuggen zu helfen.


devcon findall =ports

Anzeigen aller "nicht vorhandenen" Geräte und vorhandenen Geräte der Klasse ports (Anschlüsse).
Dies schließt auch Geräte ein, die entfernt wurden, Geräte die von einem Steckplatz zu einem anderen Steckplatz versetzt wurden, und möglicherweise auch Geräte, die aufgrund einer BIOS-Änderung anders aufgezählt wurden.


devcon listclass usb 1394

Anzeigen aller vorhandenen Geräte aller angegebenen Klassen (in diesem Fall der Klassen "USB" und "1394").


devcon remove @usb\*

Entfernen aller USB-Geräte. Entfernte Geräte werden zusammen mit dem Status der Entfernung angezeigt.


devcon rescan

Erkennen neuer PnP-Geräte.


devcon resources =ports

Anzeigen der Ressourcen, die von den Geräten der Setupklasse ports (Anschlüsse) verwendet werden.


devcon restart =net @'ROOT\*MSLOOP\0000

Neustarten des Loopbackadapters ROOT\ROOT\*MSLOOP\0000. Die im Befehl verwendeten einfachen Anführungszeichen bedeuten, dass die Instanz-ID wörtlich angegeben wird.


devcon hwids=mouse

Anzeigen aller Hardware-IDs von Geräten der Klasse "Maus" im System.


devcon sethwid @ROOT\LEGACY_BEEP\0000 := beep

Zuweisen der Hardware-ID "beep" zum Legacygerät zum Ausgeben von Signaltönen.


devcon stack =ports

Anzeigen des erwarteten Treiberstapels für das Gerät. Dies schließt Geräte- und Klassenfilter ("upper/lower") ein, sowie den Dienst, der das Gerät steuert.


devcon status @pci\*

Anzeigen des Status für jedes vorhandene Gerät, dessen Instanz-ID mit "pci\" beginnt.


devcon status @ACPI\PNP0501\1

Anzeigen des Status einer bestimmten Geräteinstanz, in diesem Fall des über ACPI (Advanced Configuration and Power Interface) aufgezählten Kommunikationsanschlusses (der seriellen Schnittstelle).


devcon status @root\rdp_mou\0000

Anzeigen des Status des Maustreibers von Microsoft Terminal Server bzw. der Terminaldienste.


devcon status *PNP05*

Anzeigen des Status aller Kommunikationsanschlüsse (COM).


devcon update mydev.inf *pnp0501

Aktualisieren aller Geräte, die genau der Hardware-ID *pnp0501 entsprechen, so dass der geeignetste mit der Hardware-ID *pnp0501 verknüpfte Treiber in "Meinger.inf" verwendet wird.

Hinweis: Durch diese Aktualisierung wird erzwungen, dass die Geräte den Treiber in "Meinger.inf" verwenden, auch wenn auf dem System ein geeigneterer Treiber vorhanden ist. Dies kann von Nutzen sein, wenn Sie während der Entwicklung eine neue Treiberversion installieren möchten, bevor eine Signatur für den Treiber verfügbar ist. Die Aktualisierung betrifft nur die Geräte, die der angegebenen Hardware-ID entsprechen. Untergeordnete Geräte sind nicht betroffen. Falls die angegebene INF-Datei nicht signiert ist, zeigt Windows möglicherweise ein Dialogfeld an, das Sie zur Bestätigung der Treiberinstallation auffordert. Falls ein Neustart erforderlich ist, wird dies angezeigt, und DevCon liefert den Fehlerstatus "1" zurück. Wenn die Option -r angegeben wurde, erfolgt der Neustart automatisch, sofern erforderlich.


Hinweise
    * DevCon liefert für die Verwendung in Skripts einen Fehlerstatus zurück:
      "0" bedeutet erfolgreiche Ausführung.
      "1" bedeutet, dass ein Neustart erforderlich ist.
      "2" weist auf einen Fehler hin.
      "3" weist auf einen Syntaxfehler hin.
    * Wenn die Option -r angegeben wurde, erfolgt der Neustart nach der Bearbeitung 
      aller Geräte ohne Vorwarnung.
    * Wenn die Option -m:\\Computer angegeben wurde und der Befehl auf einem
      Remotecomputer nicht ausgeführt werden kann, wird ein Fehler angezeigt.
    * DevCon erlaubt zur komfortableren Bedienung die Verwendung von Platzhalterzeichen
      für Instanz-IDs. Machen Sie keine Annahmen zum Format einer Instanz-ID. Sie kann
      von Computer zu Computer und von Betriebssystem zu Betriebssystem unterschiedlich
      sein.