Non Present Devices Driver Mass Unistall

hi, i have a production procedure in wich firmware of cdrom drive is updated.
If you do


you can see disconnected devices, but drivers remain installed.
The problem is that you get to a point where no more devices can be added.
The question: somebody knows a way to increase this limit or to mass unsistall all these non present devices?

Thanks in advance

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I don't need to try this myself, but I presume this would work...

first vist and download devcon.exe;EN-US;Q311272

next to list all the CDROMS...
just so you know what is removed when you...

You could get a little more sophisticated and spend a few minutes some more sophisticated scripting (you could find all the CDROMS and make a list then have a do a FINDALL removing those that didn't exist), but for CDROMS, I might just remove them all and let it reinstall whatever is attached when a rescan for new hardware is done.


fmonroyAuthor Commented:
this is perfect, i'll test it on monday, and you have the points

Thanks a lot.
fmonroyAuthor Commented:
findall works fine, detects all the non present devices

but the remove command only remove the devices that are currently connected

this is and example of disconnected device as listed with finall option:

USB\VID_1915&PID_2234\5&2A3C942C&0&5                        : Linksys Wireless-G USB Network Adapter

i tried devcon remove USB\VID_1915&PID_2234\5&2A3C942C&0&5
and i got
No devices removed.
The system cannot find the path specified.
'2A3C942C' is not recognized as an internal or external command,
operable program or batch file.
'0' is not recognized as an internal or external command,
operable program or batch file.
'5' is not recognized as an internal or external command,
operable program or batch file.
then devcon remove "USB\VID_1915&PID_2234\5&2A3C942C&0&5"
and i got
No devices removed.

any idea?
FYI: & is a special DOS command to separate multiple commands on the same line.  For instance DIR & DIR is 2 dir commands on one line.  DEL FILE.TXT && DIR executes the second DIR command if there is no error executing DEL FILE.TXT.

Yeah, so you need to use
devcon remove "USB\VID_1915&PID_2234\5&2A3C942C&0&5"
like you tried or you need to escape the special & characters with ^.
devcon remove USB\VID_1915^&PID_2234\5^&2A3C942C^&0^&5
or use a wildcard
devcon remove USB\VID_1915*

So then I also tried uninstalling a removed device and I couldn't accomplish anything.  I even tried to DEVCON INSTALL to first install the device so that I might remove it afterwards with no success.  So it appears DEVCON REMOVE only removes attached devices.

I would have thought DEVCON was the answer, you need to run it systemattically each time before you disconnect a CDROM, so put it in a batfile along with shutdown.


Your job would be much easier if you could do this via USB without the need to reboot.  Actually I would have thought that you could update most of these drives from DOS without having to boot into windows (a dos partition with a bunch of bat files).

Anyways, back to the original question... nope no more ideas.  I'd resort to attacking the registry directly.
I think that's drastic, but I went in there and deleted a bunch of entries.  (You need to change the permissions first, if there are a lot of entires to delete change the upper branch permission).  Do do it programmically, you need to use SubInAcl.exe from a Windows server resource kit to change the permission then REG DELETE to delete entry and repeat.  I wouldn't do it programmically, and I'd some REG exporting first to back things up.  Find one of those disclaimers you see all the time when they talk about modifing the registry -- this is the actual stuff they are warning against doing.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fmonroyAuthor Commented:
wow, it appears to work, i'll do some code to handle this.

Thanks a lot.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.