[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1520
  • Last Modified:

Non Present Devices Driver Mass Unistall

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

SET DEVMGR_SHOW_NONPRESENT_DEVICES=1
START DEVMGMT.MSC

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


FM
0
fmonroy
Asked:
fmonroy
  • 3
  • 2
1 Solution
 
tymesCommented:
I don't need to try this myself, but I presume this would work...

first vist and download devcon.exe
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272

next to list all the CDROMS...
DEVCON FINDALL   IDE\CDROM*
just so you know what is removed when you...
DEVCON REMOVE IDE\CDROM*

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.

DEVCON RESCAN

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

Thanks a lot.
0
 
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?
0
 
tymesCommented:
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.

DEVCON REMOVE IDE\CDROM*
SHUTDOWN  -S

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.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\
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.

0
 
fmonroyAuthor Commented:
wow, it appears to work, i'll do some code to handle this.

Thanks a lot.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now