Go Back   TechArena Community > Technical Support > Computer Help > Windows XP > XP Hardware
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Remove item from Safely Remove Hardware using registry?

XP Hardware


Reply
 
Thread Tools Search this Thread
  #1  
Old 18-01-2007
Rawling
 
Posts: n/a
Remove item from Safely Remove Hardware using registry?

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...try 587275443

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
  #2  
Old 18-01-2007
Uwe Sieber
 
Posts: n/a
Re: Remove item from Safely Remove Hardware using registry?


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\U SB\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...try 587275443
>
> 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
  #3  
Old 18-01-2007
Rawling
 
Posts: n/a
Re: Remove item from Safely Remove Hardware using registry?

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\U SB\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...try 587275443
> >
> > 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
  #4  
Old 18-01-2007
Rawling
 
Posts: n/a
Re: Remove item from Safely Remove Hardware using registry?

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\U SB\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...try 587275443
> > >
> > > 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
  #5  
Old 20-01-2007
Uwe Sieber
 
Posts: n/a
Re: Remove item from Safely Remove Hardware using registry?


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\U SB\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...try 587275443
>>>>
>>>> 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
  #6  
Old 20-01-2007
Rawling
 
Posts: n/a
Re: Remove item from Safely Remove Hardware using registry?

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\U SB\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...try 587275443
> >>>>
> >>>> 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

  TechArena Community > Technical Support > Computer Help > Windows XP > XP Hardware


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads for: "Remove item from Safely Remove Hardware using registry?"
Thread Thread Starter Forum Replies Last Post
Remove the safely remove hardware icon from the task bar Tungesh Customize Desktop 2 10-08-2009 11:13 PM
Safely Remove Hardware Error alikane Vista Hardware Devices 5 21-02-2009 10:17 PM
Safely Remove Hardware t-4-2 Vista Hardware Devices 7 16-01-2009 07:17 PM
'safely remove hardware' - in camera ? Emo Hardware Peripherals 3 25-10-2008 03:09 PM
Remove hardware from "Safely Remove Hardware" list -John T Vista Hardware Devices 1 07-08-2007 10:49 PM


All times are GMT +5.5. The time now is 08:01 PM.