Вы находитесь на странице: 1из 4

The DevCon command-line utility functions as an alternative to Device Manager

View products that this article applies to. Article ID : 311272 Last Review : January ! 2""# Revision : ."

$his article was previously pu%lished under &311272

On This Page
'())AR* )+R, I-.+R)A$I+(sin/ Dev0on ,1a2ple Dev0on co22ands -otes

SUMMARY
$he Dev0on utility is a co22and3line utility that acts as an alternative to Device )ana/er. (sin/ Dev0on! you can ena%le! disa%le! restart! update! re2ove! and 4uery individual devices or /roups o5 devices. Dev0on also provides in5or2ation that is relevant to the driver developer and is not availa%le in Device )ana/er. *ou can use Dev0on with )icroso5t 6indows 2"""! 6indows 78! and 6indows 'erver 2""3. *ou cannot use Dev0on with 6indows 9 ! 6indows 9:! or 6indows )illenniu2 ,dition. ;ac< to the top

MOR

!"#ORMAT!O"

Dev0on is not redistri%uta%le. It is provided 5or use as a de%u//in/ and develop2ent tool. *ou can 5reely 2odi5y Dev0on 5or private use. $he sa2ple de2onstrates how to use the 'etupA8I and 05/)/r32 5unctions to/ether e55ectively to enu2erate devices and per5or2 device operations. $he 5ollowin/ 5ile is availa%le 5or download 5ro2 the )icroso5t Download 0enter: Download the Dev0on pac<a/e now. Release Date: Jan32932""3 .or 2ore in5or2ation a%out how to download )icroso5t support 5iles! clic< the 5ollowin/ article nu2%er to view the article in the )icroso5t =nowled/e ;ase: 119 91 >ow to o%tain )icroso5t support 5iles 5ro2 online services )icroso5t scanned this 5ile 5or viruses. )icroso5t used the 2ost current virus3detection so5tware that was availa%le on the date that the 5ile was posted. $he 5ile is stored on security3enhanced servers that help prevent any unauthori?ed chan/es to the 5ile. $he Dev0on.e1e 5ile contains the 5ollowin/ 5iles: #ile Descri$tion

I3:#@Dev0on.e1e 323%it Dev0on tool %inary. $his will not 5unction co2pletely on #A3%it 6indows. Ia#A@Dev0on.e1e #A3%it Dev0on tool %inary. "ote $he source code 5or Dev0on is also availa%le in the 6indows DD= Bwhich is availa%le 5ro2 http:CCwww.2icroso5t.co2CwhdcCdevtoolsCdd<Cde5ault.2sp1D under DDK root@'rc@'etup@Devcon! alon/ with docu2entation. ;ac< to the top

Using DevCon
Dev0on is a co22and3line utility with %uilt3in docu2entation. I5 you run the devcon hel$ co22and! the 5ollowin/ list o5 co22ands and descriptions appears. $he devcon hel$ co22and will /ive 2ore detailed help on any co22and. 6ith so2e o5 these co22ands! you can speci5y a re2ote tar/et co2puter. $hese co22ands wor< i5 you are usin/ the 323%it version o5 Dev0on on 6+6#A.

Device Console Help: devcon.exe [-r] [-m:\\<machine>] <command> [<arg>...] -r if specified will reboo machine af er command is comple e! if needed. <machine> is name of arge machine. <command> is command o perform "see below#. <arg>... is one or more arg$men s if re%$ired b& command. 'or help on a specific command! &pe: devcon.exe help <command> classfil er (llows modifica ion of class fil ers. classes

)is all device se $p classes. disable Disable devices ha ma ch he specific hardware or ins ance *D. driverfiles )is driver files ins alled for devices. drivernodes )is s all he driver nodes of devices. enable +nable devices ha ma ch he specific hardware or ins ance *D. find 'ind devices ha ma ch he specific hardware or ins ance *D. findall 'ind devices incl$ding hose ha are no presen . help Displa& his informa ion. hwids )is s hardware *D,s of devices. ins all -an$all& ins all a device. lis class )is all devices for a se $p class. reboo .eboo local machine. remove .emove devices ha ma ch he specific hardware or ins ance *D. rescan /can for new hardware. reso$rces )is s hardware reso$rces of devices. res ar .es ar devices ha ma ch he specific hardware or ins ance *D. s ac0 )is s expec ed driver s ac0 of devices. s a $s )is r$nning s a $s of devices. $pda e -an$all& $pda e a device. 1pda e2* -an$all& $pda e a device wi ho$ $ser promp /e Hw*D (dds! dele es! and changes he order of hardware *Ds of roo -en$mera ed devices.
%am$le DevCon commands
devcon -m&''test find $ci'( Lists all <nown 80I devices on the co2puter test. B;y usin/-m! you can speci5y a tar/et co2puter. *ou 2ust use Interprocess co22unication BI80D to access the co2puter.D devcon -r install %WINDIR%'!nf'"etloo$)inf (MS*OOP Installs a new instance o5 the )icroso5t loop%ac< adaptor. $his creates a new root3enu2erated device node with which you can install a Evirtual device!E such as the loop%ac< adaptor. $his co22and also restarts the co2puter silently i5 a restart is re4uired. devcon classes Lists all <nown setup classes. $he output contains the short nonlocali?ed na2e B5or e1a2ple! E(';ED and the descriptive na2e B5or e1a2ple! E(niversal 'erial ;us controllersED. devcon classfilter u$$er +filter, +filterDeletes the two speci5ied 5ilters. devcon classfilter lo.er +/adfilter 0goodfilter Replaces the E%ad5ilterE with the E/ood5ilterE. devcon driverfiles 1$orts Lists 5iles that are associated with each device in the $orts setup class. devcon disa/le (MS*OOP Disa%les all devices that have a hardware ID that ends in E)'L++8E Bincludin/ EF)'L++8ED. devcon drivernodes 2ROOT'PC!34A*'P"P5A56 Lists all co2pati%le drivers 5or the device ROOT'PC!34A*'P"P5A56. $his can %e used to deter2ine why an inte/ral device in5or2ation B.in5D 5ile was chosen! instead o5 a third3party .in5 5ile. devcon ena/le 7(MS*OOP ,na%les all devices that have a hardware ID o5 EF)'L++8E. $he sin/le 4uotation 2ar< indicates that the hardware ID 2ust %e ta<en literally Bin other words! the asteris< GEFEH actually is an asteris<I it is not a wildcard characterD. devcon find ( Lists device instances o5 all devices that are present on the local co2puter. devcon find $ci'( Lists all <nown peripheral co2ponent interconnect B80ID devices that are on the local co2puter Bthis co22and assu2es that a device is 80I i5 it has a hardware ID that is pre5i1ed %y E80I@ED. devcon find 1$orts ($n$( Lists devices that are present that are a 2e2%er o5 the $orts setup class and that contain E8-8E in their hardware ID. devcon find 1$orts 2root'( Lists devices that are present that are a 2e2%er o5 the $orts setup class and that are in the ErootE %ranch o5 the enu2 tree

Bthe instance ID is pre5i1ed %y Eroot@ED. -ote that you should not 2a<e any pro/ra22atic assu2ption a%out how an instance ID is 5or2atted. $o deter2ine root devices! you can loo< at device status %its. $his 5eature is included in Dev0on to aid in de%u//in/. devcon findall 1$orts Lists EnonpresentE devices and devices that are present 5or the $orts class. $his includes devices that have %een re2oved! devices that have %een 2oved 5ro2 one slot to another! and! in so2e cases! devices that have %een enu2erated di55erently due to a ;I+' chan/e. devcon listclass us/ ,689 Lists all devices that are present 5or each class na2ed Bin this case! ('; and 139AD. devcon remove 2us/'( Re2oves all ('; devices. Devices that are re2oved are listed with their re2oval status. devcon rescan Rescans 5or new 8lu/ and 8lay devices. devcon resources 1$orts Lists the resources that are used %y all devices in the $orts setup class. devcon restart 1net 27ROOT'(MS*OOP'5555 Restarts the loop%ac< adaptor ROOT'(MS*OOP'5555. $he sin/le 4uotation 2ar< in the co22and indicates that the instance ID 2ust %e ta<en literally. devcon h.ids1mouse Lists all hardware IDs o5 2ouse class devices on the syste2. devcon seth.id 2ROOT'* :ACY3; P'5555 &1 /ee$

Assi/n the hardware ID! %eep! to the le/acy %eep device. devcon stac< 1$orts Lists the e1pected driver stac< 5or the device. $his includes device and class upperClower 5ilters! and the controllin/ service. devcon status 2$ci'( Lists the status o5 each device present that has an instance ID that %e/ins with Epci@E. devcon status 2ACP!'P"P5=5,', Lists the status o5 a speci5ic device instance! in this case an Advanced 0on5i/uration and 8ower Inter5ace BA08ID3enu2erated serial port. devcon status 2root'rd$3mou'5555 Lists the status o5 the )icroso5t $er2inal 'erver or $er2inal 'ervices 2ouse driver. devcon status (P"P5=( Lists the status o5 all 0+) ports. devcon u$date mydev)inf ($n$5=5, (pdates all devices that e1actly 2atch the hardware ID ($n$5=5, to use the %est driver in )ydev.in5 that is associated with the hardware ID ($n$5=5,. "ote $his update 5orces all devices to use the driver in )ydev.in5! even i5 there is a %etter 2atch already on the syste2. $his is use5ul when you want to install new versions o5 drivers durin/ develop2ent %e5ore you o%tain a si/nature. $he update a55ects only the devices that 2atch the speci5ied hardware ID! and does not a55ect the child devices. I5 the speci5ied .in5 5ile is unsi/ned! 6indows 2ay display a dialo/ %o1 that pro2pts you to con5ir2 whether the driver should %e installed. I5 a restart is re4uired! this is reported and Dev0on returns a level 1 error. I5 you speci5y -r! this causes a restart to occur auto2atically i5 one is re4uired.

"otes

J Dev0on will return an error level 5or use in scripts:

J J I5 you speci5y -m&''computer and the co22and will not wor< 5or a re2ote co2puter! an error is reported. J Dev0on allows wildcards in instance IDs 5or interactive convenience. Do not assu2e anythin/ a%out the 5or2at o5 an
instance ID 5ro2 co2puter to co2puter and 5ro2 operatin/ syste2 version to operatin/ syste2 version.

E"E indicates a success. E1E indicates that a restart is re4uired. E2E indicates a 5ailure. E3E indicates a synta1 error. I5 you speci5y -r and a restart is re4uired! the restart occurs without warnin/ a5ter all devices have %een processed.

Kod mene : devcon remove @USBSTOR\*

Вам также может понравиться