Re: Remove item from Safely Remove Hardware using registry?

Discussion in 'Windows XP Hardware' started by Uwe Sieber, Jan 18, 2007.

  1. Uwe Sieber

    Uwe Sieber Guest

    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.php?showtopic=427449&st=30&p=587275443&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.
    >
     
    Uwe Sieber, Jan 18, 2007
    #1
    1. Advertisements

  2. Uwe Sieber

    Uwe Sieber Guest

    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.php?showtopic=427449&st=30&p=587275443&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.
    >>>>
     
    Uwe Sieber, Jan 20, 2007
    #2
    1. Advertisements

  3. Uwe Sieber

    Guest Guest

    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.php?showtopic=427449&st=30&p=587275443&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.
    > >>>>

    >
     
    Guest, Jan 20, 2007
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. plus net
    Replies:
    4
    Views:
    429
    Andrew McDonald
    Apr 23, 2004
  2. Guest
    Replies:
    0
    Views:
    414
    Guest
    May 8, 2005
  3. Donald Parvis

    Want to Remove "safely remove hardware" icon from system tray

    Donald Parvis, Jun 28, 2005, in forum: Windows XP Hardware
    Replies:
    1
    Views:
    762
  4. LuDean Marvin

    Remove "Safely Remove Hardware" icon

    LuDean Marvin, Jul 26, 2008, in forum: Windows XP Hardware
    Replies:
    7
    Views:
    252
    Dragomir Kollaric
    Aug 21, 2008
  5. Patrick Keenan

    Re: Dongle-remove without "safely remove hardware"

    Patrick Keenan, Mar 1, 2009, in forum: Windows XP Hardware
    Replies:
    0
    Views:
    409
    Patrick Keenan
    Mar 1, 2009
Loading...

Share This Page