PC Review


Reply
Thread Tools Rate Thread

Re: Remove item from Safely Remove Hardware using registry?

 
 
Uwe Sieber
Guest
Posts: n/a
 
      18th Jan 2007

Devices are shown there if they are marked as removable and
if they do no have the 'surprise removal ok' flag. These are
bit coded flags:

From cfgmgr32.h:
#define CM_DEVCAP_REMOVABLE (0x00000004)
#define CM_DEVCAP_SURPRISEREMOVALOK (0x00000080)

The device capabilities are found in the registry in a value
named 'Capabilities' under (sample for one of my USB flash
drives):
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_058f&Pid_6331\058F091111B

If you take away 4 from the value or add 80h and then
refresh the save removal dialog by toggeling the checkbox,
then the drive is gone.
But the value is reset when you attach the drive for the
next time. I think this is hard coded into the driver.

Uwe






Rawling wrote:
> Hi,
> I have a USB CF card reader plugged into my PC, and it has added itself to
> the list of items that appear on the Safely Remove Hardware menu. Well,
> actually it's the only such item, and I want to remove it.
> I don't want to just hide the icon in my Notification Area, or remove the
> icon, I want to remove this piece of hardware from the list.
>
> The tree for the reader is
> USB Mass Storage Device
> ->OEI-USB CompactFlash USB Device
> --->Generic volume - (F
>
> This shows up regardless of whether there is a card in the reader. It makes
> no sense for the reader itself to be Safely Removed - if I want to take the
> card out I can right-click on the card in My Computer and go Eject; if I want
> to actually remove the reader, well, I can just unplug it. It's just an inert
> piece of hardware. It's not going to lose anything.
>
> Now, the reason I'm so worked up about this is that I know there's a way to
> remove this in the registry. At some point in the install Windows, or the
> supplied driver, decided that this hardware is removable or somesuch. This is
> shown by a registry key located somewhere in
> HKLM\SYSTEM\CurrentControlSet\Enum\...
>
> The item "Generic Volume F" is then located at
> ...\STORAGE\RemovableMedia\{...code from the dirver panel}
>
> The item "OEI-USB CompactFlash USB Device" is instead located at
> ...\USBSTOR\{...other code corresponding}\{...more code}
>
> Both of these Keys contain a Value (REG_DWORD) named Capabilities.
>
> I think that this value is a series of binary flags that denote different
> capabilities of the item; I also think that one or more of these flags are
> what tells Windows that the item is Removeable and as such should show up in
> the Safely Remove list.
>
> However, I am unsure on a number of points, even if I'm right so far:
>
> - How is this value constructed? What binary digit corresponds to what
> capability?
> - Which particular item should I be editing? The reader or the "volume"?
>
> The reason I am sure I'm along the right lines is, admittedly, one forum post:
>
> http://www.neowin.net/forum/index.ph...entry587275443
>
> I am just surprised that this isn't documented anywhere, that no-one has
> advertised this as a method for the (common) probelm of "I want to get rid of
> this Safely Remove icon, it's stupid that Windows is letting me eject my
> primary hard drive" etc.
>
> I hope someone understands all of this; I don't really myself.
>

 
Reply With Quote
 
 
 
 
Uwe Sieber
Guest
Posts: n/a
 
      20th Jan 2007

The decision to show or not to show this icon is probably
made only when a device is attached or removed. So, the
icon might disappear after an USB device has been attached
and then removed.

It should be possible to save the modified value into a
REG file and load it on startup like this:
regedit /s xxxx.reg

Uwe



Rawling wrote:
> Sorry, I spoke too soon. Altering that value and then refreshing the SRH list
> does indeed remove the entry. However, the SRH icon still does not go away -
> even though there is nothing left to Stop - and on reboot the registry value
> has gone back to what it was originally, and the icon is back complete with
> entry for the reader.
>
> Any more nuggets of wisdom?
>
> "Rawling" wrote:
>
>> Thank you so much, this worked perfectly :-)
>>
>> I was a bit worried because neither of the keys I listed had 4 in that
>> value, but I found the corresponding key under the \USB\ folder and it had a
>> 4 to subtract.
>>
>> Thank you again.
>>
>> "Uwe Sieber" wrote:
>>
>>> Devices are shown there if they are marked as removable and
>>> if they do no have the 'surprise removal ok' flag. These are
>>> bit coded flags:
>>>
>>> From cfgmgr32.h:
>>> #define CM_DEVCAP_REMOVABLE (0x00000004)
>>> #define CM_DEVCAP_SURPRISEREMOVALOK (0x00000080)
>>>
>>> The device capabilities are found in the registry in a value
>>> named 'Capabilities' under (sample for one of my USB flash
>>> drives):
>>> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_058f&Pid_6331\058F091111B
>>>
>>> If you take away 4 from the value or add 80h and then
>>> refresh the save removal dialog by toggeling the checkbox,
>>> then the drive is gone.
>>> But the value is reset when you attach the drive for the
>>> next time. I think this is hard coded into the driver.
>>>
>>> Uwe
>>>
>>>
>>>
>>>
>>>
>>>
>>> Rawling wrote:
>>>> Hi,
>>>> I have a USB CF card reader plugged into my PC, and it has added itself to
>>>> the list of items that appear on the Safely Remove Hardware menu. Well,
>>>> actually it's the only such item, and I want to remove it.
>>>> I don't want to just hide the icon in my Notification Area, or remove the
>>>> icon, I want to remove this piece of hardware from the list.
>>>>
>>>> The tree for the reader is
>>>> USB Mass Storage Device
>>>> ->OEI-USB CompactFlash USB Device
>>>> --->Generic volume - (F
>>>>
>>>> This shows up regardless of whether there is a card in the reader. It makes
>>>> no sense for the reader itself to be Safely Removed - if I want to take the
>>>> card out I can right-click on the card in My Computer and go Eject; if I want
>>>> to actually remove the reader, well, I can just unplug it. It's just an inert
>>>> piece of hardware. It's not going to lose anything.
>>>>
>>>> Now, the reason I'm so worked up about this is that I know there's a way to
>>>> remove this in the registry. At some point in the install Windows, or the
>>>> supplied driver, decided that this hardware is removable or somesuch. This is
>>>> shown by a registry key located somewhere in
>>>> HKLM\SYSTEM\CurrentControlSet\Enum\...
>>>>
>>>> The item "Generic Volume F" is then located at
>>>> ...\STORAGE\RemovableMedia\{...code from the dirver panel}
>>>>
>>>> The item "OEI-USB CompactFlash USB Device" is instead located at
>>>> ...\USBSTOR\{...other code corresponding}\{...more code}
>>>>
>>>> Both of these Keys contain a Value (REG_DWORD) named Capabilities.
>>>>
>>>> I think that this value is a series of binary flags that denote different
>>>> capabilities of the item; I also think that one or more of these flags are
>>>> what tells Windows that the item is Removeable and as such should show up in
>>>> the Safely Remove list.
>>>>
>>>> However, I am unsure on a number of points, even if I'm right so far:
>>>>
>>>> - How is this value constructed? What binary digit corresponds to what
>>>> capability?
>>>> - Which particular item should I be editing? The reader or the "volume"?
>>>>
>>>> The reason I am sure I'm along the right lines is, admittedly, one forum post:
>>>>
>>>> http://www.neowin.net/forum/index.ph...entry587275443
>>>>
>>>> I am just surprised that this isn't documented anywhere, that no-one has
>>>> advertised this as a method for the (common) probelm of "I want to get rid of
>>>> this Safely Remove icon, it's stupid that Windows is letting me eject my
>>>> primary hard drive" etc.
>>>>
>>>> I hope someone understands all of this; I don't really myself.
>>>>

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UmF3bGluZw==?=
Guest
Posts: n/a
 
      20th Jan 2007
Thank you' this has not only kept the registry value constant after reboot,
but has stopped the SRH icon showing up even though the list is empty.

Thank you so much for solving this for me

"Uwe Sieber" wrote:

>
> The decision to show or not to show this icon is probably
> made only when a device is attached or removed. So, the
> icon might disappear after an USB device has been attached
> and then removed.
>
> It should be possible to save the modified value into a
> REG file and load it on startup like this:
> regedit /s xxxx.reg
>
> Uwe
>
>
>
> Rawling wrote:
> > Sorry, I spoke too soon. Altering that value and then refreshing the SRH list
> > does indeed remove the entry. However, the SRH icon still does not go away -
> > even though there is nothing left to Stop - and on reboot the registry value
> > has gone back to what it was originally, and the icon is back complete with
> > entry for the reader.
> >
> > Any more nuggets of wisdom?
> >
> > "Rawling" wrote:
> >
> >> Thank you so much, this worked perfectly :-)
> >>
> >> I was a bit worried because neither of the keys I listed had 4 in that
> >> value, but I found the corresponding key under the \USB\ folder and it had a
> >> 4 to subtract.
> >>
> >> Thank you again.
> >>
> >> "Uwe Sieber" wrote:
> >>
> >>> Devices are shown there if they are marked as removable and
> >>> if they do no have the 'surprise removal ok' flag. These are
> >>> bit coded flags:
> >>>
> >>> From cfgmgr32.h:
> >>> #define CM_DEVCAP_REMOVABLE (0x00000004)
> >>> #define CM_DEVCAP_SURPRISEREMOVALOK (0x00000080)
> >>>
> >>> The device capabilities are found in the registry in a value
> >>> named 'Capabilities' under (sample for one of my USB flash
> >>> drives):
> >>> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_058f&Pid_6331\058F091111B
> >>>
> >>> If you take away 4 from the value or add 80h and then
> >>> refresh the save removal dialog by toggeling the checkbox,
> >>> then the drive is gone.
> >>> But the value is reset when you attach the drive for the
> >>> next time. I think this is hard coded into the driver.
> >>>
> >>> Uwe
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> Rawling wrote:
> >>>> Hi,
> >>>> I have a USB CF card reader plugged into my PC, and it has added itself to
> >>>> the list of items that appear on the Safely Remove Hardware menu. Well,
> >>>> actually it's the only such item, and I want to remove it.
> >>>> I don't want to just hide the icon in my Notification Area, or remove the
> >>>> icon, I want to remove this piece of hardware from the list.
> >>>>
> >>>> The tree for the reader is
> >>>> USB Mass Storage Device
> >>>> ->OEI-USB CompactFlash USB Device
> >>>> --->Generic volume - (F
> >>>>
> >>>> This shows up regardless of whether there is a card in the reader. It makes
> >>>> no sense for the reader itself to be Safely Removed - if I want to take the
> >>>> card out I can right-click on the card in My Computer and go Eject; if I want
> >>>> to actually remove the reader, well, I can just unplug it. It's just an inert
> >>>> piece of hardware. It's not going to lose anything.
> >>>>
> >>>> Now, the reason I'm so worked up about this is that I know there's a way to
> >>>> remove this in the registry. At some point in the install Windows, or the
> >>>> supplied driver, decided that this hardware is removable or somesuch. This is
> >>>> shown by a registry key located somewhere in
> >>>> HKLM\SYSTEM\CurrentControlSet\Enum\...
> >>>>
> >>>> The item "Generic Volume F" is then located at
> >>>> ...\STORAGE\RemovableMedia\{...code from the dirver panel}
> >>>>
> >>>> The item "OEI-USB CompactFlash USB Device" is instead located at
> >>>> ...\USBSTOR\{...other code corresponding}\{...more code}
> >>>>
> >>>> Both of these Keys contain a Value (REG_DWORD) named Capabilities.
> >>>>
> >>>> I think that this value is a series of binary flags that denote different
> >>>> capabilities of the item; I also think that one or more of these flags are
> >>>> what tells Windows that the item is Removeable and as such should show up in
> >>>> the Safely Remove list.
> >>>>
> >>>> However, I am unsure on a number of points, even if I'm right so far:
> >>>>
> >>>> - How is this value constructed? What binary digit corresponds to what
> >>>> capability?
> >>>> - Which particular item should I be editing? The reader or the "volume"?
> >>>>
> >>>> The reason I am sure I'm along the right lines is, admittedly, one forum post:
> >>>>
> >>>> http://www.neowin.net/forum/index.ph...entry587275443
> >>>>
> >>>> I am just surprised that this isn't documented anywhere, that no-one has
> >>>> advertised this as a method for the (common) probelm of "I want to get rid of
> >>>> this Safely Remove icon, it's stupid that Windows is letting me eject my
> >>>> primary hard drive" etc.
> >>>>
> >>>> I hope someone understands all of this; I don't really myself.
> >>>>

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove hardware from "Safely Remove Hardware" list =?Utf-8?B?LUpvaG4gVA==?= Windows Vista Hardware 1 7th Aug 2007 06:19 PM
There is no "safely remove hardware" tab after using USB hardware =?Utf-8?B?Q2hpbm1heQ==?= Windows XP General 3 28th May 2006 07:21 PM
How do I remove "safely remove hardware" function? George D Windows XP Performance 2 25th Apr 2004 07:22 PM
How do I remove the "safely remove hardware" icon in the task bar? Glen Windows XP General 0 16th Nov 2003 09:14 PM
how to remove the safely remove hardware joe Windows XP Help 1 4th Nov 2003 02:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:06 AM.