My new laptop has a removable DVD drive, which is nice, but I’ll rarely–if ever–remove it and because it’s removable Windows puts the Safely Remove Hardware icon in the system tray, which is annoying to someone who is as nuerotic and anal-retentive as I am. If you search for a way to remove it most webpages will only give you bad workarounds (like hiding the icon itself instead of changing the device to be considered non-removable) or tell you it’s impossible to fix. But, I found a real solution in a usenet post and thought it’d be helpful to write out some clear instructions.
The driver for the device has a flag telling Windows that it is a ‘removable’ device, which gets loaded into the registry whenever the device is loaded. So, you basically just need to setup a way to automatically overwrite the registry value when the system boots.
First you’ll need to get the ID of the device you want to remove.
- Open Device Manager (Start > Run > devmgmt.msc)
- Right-click on the device and go to Properties, then open the Details tab
- The ‘Device Instance Id’ item will be selected by default in the drop-down list
- It will look something like ‘IDE\CDROMPBDS_DVD+RW_DS8W1P\[…]\DB1B\[…]\5&C10F4F&0&0.0.0
- Keep that window open, or write down the ID because you’ll need it in the next step
The next step is to modify the removable value in the registry.
- Open the registry editor (Start > Run > regedit)
- Drill down to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum
- Then use the sections of the ID to locate the device (e.g., IDE, then CDROMPBDS_DVD+RW_DS8W1P\[…]\DB1B\[…] then 5&C10F4F&0&0.0.0
- By default you probably won’t have permssion to modify the value, so right click on the key (folder) and go to Permissions and give your account ‘Full Control’
- Inside that key will be a value named ‘Capabilities’, which will have a value of 4 or 6 or some higher number
- Right click on the value and select ‘Modify,’ then subtract 4 from the value (e.g., change 6 to 2, 4 to 0, etc) and click ‘Ok’
At this point the device isn’t recognized as removable. It might take windows a moment to update the Safely Remove Hardware app, or you might have to open it up to refresh it, but the device is updated. The icon may stick around, but after the next step that will be taken care of.
The last step is to make sure that the value is automatically updated every time Windows boots (because the value is loaded from the device driver every time, so we have to overwrite it every time).
- Go to File > Export and save the key to somewhere on your computer
-
Open it with a text editor and get rid of all the extra subkeys and values that we don’t want to change. In the end it should look something like this:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE\CdRomPBDS_DVD+-RW_DS-8W1P____________________BD1B____\5&c10f4f&0&0.0.0]
“Capabilities”=dword:00000002 - Back in the registry editor, browse to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
- Right click > New > String value
- Give it a name then Right click and Modify
- Enter regedit /s “C:\Documents and Settings\user\My Documents\DVD Not Removable.reg” (Update the path for where you saved the file and what you named it)
Now that .reg file containing the updated value will be loaded every time you log on to your account and (assuming it was the only removable device) the Safely Remove Hardware icon won’t show up anymore.
Update: Check comment #28 if you’re running Windows 7
1) josh »» December 11th, 2007 @ 9:16 pm
That made as much sense to me as Reganomics. I’m a tool.
Yeah, I know it’s not the kind of stuff I usually post, but I’ve tried to find a fix for that before and never have, so thought I’d post it so the search engines can pick it up and other people can find it.
Well you were first one on Google when I searched for the problem. Soemthing I searched pretty heavily for a few months back with no luck. I’ll give it a try later on when I’m feeling risky.
Cool, let me know if the instructions weren’t clear enough or if you have any issues.
On Vista home premium, when I try to change the permissions it says Unable to save permission changes, access is denied…
Ironic isn’t it?
Is your account a member of the local Administrators group? Go to Start > Run > lusrmgr.msc > Groups > Administrators > Right click > Properties to check.
Thank you, I have laptop Dell Inspiration with the same issue(?), and since I`m enough pedant, that icon just tickled me out :) …but I haven`t that location “HKEY_CURRENT_USER\Software\Microsoft\CurrentVersion\Run” in my registry… icon just disapeared itself, as I changed the value from 6 to 2 and saved. But I haven`t restarted yet.
It’ll probably come back once you restart, because the value is loaded into the registry from the driver. We can’t change the driver, but we can change the registry, so we need to have the value changed in the registry every time the driver is loaded.
I had an error in the directions, the path is actually
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
(the ‘Windows’ key was left out)
That’s a great find, but you don’t have to re-import the value every time you start windows. Instead you can keep the system from modifying it:
Edit the permissions of the key and choose ‘Advanced’, then disable the “Inherit from parent…” option and choose to copy the current values.
Edit the ‘SYSTEM’ permission entry and disable the “Set Value” option.
Once you restart, the value should no longer be modified automatically.
I have been looking for this for a long long time.
To change the value I first had to change the permissions on the key. Else I got an access denied error.
Only SYSTEM had Full Control so I had to add myself (Administrator) and give me Full Control.
Then I did as Mike said but after a reboot the value was 6 again and also the bloody icon in my system tray came back.
I tried a lot of other permission settings but nothing worked. Even denying permission to anyone did’t work.
It would have been nicer like this but then I used the change registry every time method and that works fine.
Me so happy. :-)
[…] My new laptop has a removable DVD drive, which is nice, but I’ll rarely–if ever–remove it and because it’s removable Windows puts the Safely Remove Hardware icon in the system tray, which is annoying to someone who is as nuerotic and anal-retentive as I am. If you search for a way to remove it most webpages will only give you bad workarounds (like hiding the icon itself instead of changing the device to be considered non-removable) or tell you it’s impossible to fix. But, I found a real solution in a usenet post and thought it’d be helpful to write out some clear instructions on how to remove a device from the ‘Safety Remove Hardware’ app […]
Thanks, I’d lost some of the details about this.
On Vista the registry update can be applied automatically by creating a Scheduled Task that is run at every StartUp.
The task should use “SYSTEM” user with “Run with highest privileges” ticked, to satisfy the default Registry permissions and prevent “User Access Control” from complaining.
Task should run:-
C:\windows\regedit.exe
with parameters:-
/s filename.reg
This seems to work well for non-removable USB and non-removable SATA devices.
For USB card readers use the id of the parent reader rather than the individual drives, use the “Eject” option from the drive’s right-click menu before removing a card.
grrr! i though this would be the end of a long google search, but sadly i had 2 problems. firstly and most importantly i could not give my self (the administrator (the only user)) permission to change the registry file. only the system has full control.
the other problem is that i couldn’t find the Device Instance Id (ven_10DE&DEV_03 bla bla bla) for my 2 sata HDD, 2 sata DVD burners or my built in 5 in 1 card reader.
my system info,
OS-windows vista home premium version 6.0.6000 build 6000
CPU-AMD Athlon 64 X2 5600+
MotherBoard-dont no know the mother board
BIOS Version/Date-Dell inc. 1.0.9, 09/01/2008
Package-dell inspiron 531
Super article.. but adding the hack to local machine would be better than current user. anyway many thanks… another job in setting up windows xp along with all the numerous other changes and hacks to make the system beautiful
Absolute genius!
Worked like a charm. Thank you from me and all the other anal retentives that are annoyed by things like this.
You’re a star.
The thing here is why do we have to do this?
I have a sata drive in my HP laptop that initially installed and on the recovery disc HAS a driver that does not set that flag, it is not seen as removable from the get go; reason being that the accellerometer HD protection Sw will not function with “removable” drives.
This is on vista x64, if I can get that driver to load for win 7, then I would have my HD, my HD protection as well.
I just used this method for two SATA hard drives I have that show up in ‘Safely Remove Hardware’. This was one of the first links to come up through google.
It worked great! Exactly what I wanted.
I have Windows XP Pro with SP3 BTW
Here are some more information about this
http://www.uwe-sieber.de/usbtrouble_e.html#remove_from_safely_remove
Brilliant solution for the DVD drive on my Dell laptop. Thanks!
Works perfectly on XP SP3.
To all those who don’t fully understand the instructions: you have to edit the registry several times, which can screw up your system badly if you get it wrong. So don’t even try this if you don’t know how regedit works.
followed the instructions but the icon stays
Worked for me on XP SP3 as well. Many thanks!
A few months ago I installed windows 7. I tried this same exact thing, but it failed because by default Windows 7 doesn’t give users permission to change that part of the registry. Here is what I did to let me edit the keys I needed to edit (everything else works exactly the same):
1) Right click on the key (folder) that contains the value you’d like to change, and click on Permissions…
2) Click Advanced and then select the Owner tab
3) Click on your user name and put a check in the box labeled “Replace owner on subcontainers and objects” tab
4) Click Apply. You might get an error (I did), but it still works.
5) Go back to the Permissions tab
6) Click Add and enter your user name in the box
7) Click Check Names, and hit OK if it seems to find your user name
8) Put a check in the box next to Full Control under Allow.
9) Hit OK and ignore any more errors.
10) Try to edit your value now.
Hope that helps! Fully working with Windows 7 using those added bits of information.
thanks problem solved! it was really helpful
It seems that at some point in the last couple days my Windows 7 registry permissions went back to the defaults, so the fix broke. I changed them back and fixed it, but this means my post above might not fully work. I’ll post back here with anything else I find. Setting up a Scheduled Task to run with highest privileges didn’t seem to bypass the permission problem for me either.
Thanks Nick, keep us updated.
Do you have to use the HKCU branch, can you use the HKLM branch instead?
I have found a solution for this in Windows 7 that survives reboots! It also looks like it’s the proper way to do this.
Original link here: http://superuser.com/questions/12955/how-do-i-remove-the-option-to-eject-sata-drives-from-the-windows-7-tray-icon
Copy/pasted relevant part here: (incase original link dies)
============SNIP SNIP==============
The answer really depends on what driver you’re set up with. I have a 6 port SATA connector (Intel ICH9 – 2922) and I use the default MS-AHCI driver. If you’re in the same boat, create a couple of new keys here:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\msahci
_
\Controller0\Channel0
\Channel1
\Channel2
\Channel3
\Channel4
\Channel5
Now create a new DWORD – name: TreatAsInternalPort, value: 1 under each of the ChannelN keys. Now reboot for the changes to take effect and the drives should no longer show up under ‘Safely Remove..’
Geeky stuff:
The root cause of the problem is the SATA driver incorrectly determined that your internal SATA port is external. So, if you look at the ‘Capabilities’ value for your drive(s) under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE\..\.. its probably set at 0x4 which makes it removable (as per the bit flag ORing done of the values below) Once you add the setting to the registry, the SATA driver now returns a different Capabilities value (most probably 0) and the drive stops showing up under ‘Safely Remove..’
//from inc/api/cfgmgr32.h (WINDDK)
#define CM_DEVCAP_LOCKSUPPORTED (0x00000001)
#define CM_DEVCAP_EJECTSUPPORTED (0x00000002)
#define CM_DEVCAP_REMOVABLE (0x00000004)
#define CM_DEVCAP_DOCKDEVICE (0x00000008)
#define CM_DEVCAP_UNIQUEID (0x00000010)
#define CM_DEVCAP_SILENTINSTALL (0x00000020)
#define CM_DEVCAP_RAWDEVICEOK (0x00000040)
#define CM_DEVCAP_SURPRISEREMOVALOK (0x00000080)
#define CM_DEVCAP_HARDWAREDISABLED (0x00000100)
#define CM_DEVCAP_NONDYNAMIC (0x00000200)
============SNIP SNIP==============
Now just to make this clear, what you need to do is make 7 distinct new ‘keys’ (folders) in your registry: one called Controller0, then 6 underneath that labelled Channel0 to Channel5. Inside each of these 6 subfolders, make a new DWORD 32 bit and name it TreatAsInternalPort and set the value to 1. Reboot your computer and the icon shouldn’t even appear!
Note that you may be using a different hard disk driver, and you may have fewer ports on your motherboard – a common configuration is only 4 ports, in which case you’d only need Channel0 to Channel3, but I think if you had the extra Channel4 and Channel5 you wouldn’t harm anything.
Also, if you have any ports designated as eSata ports, then I would leave the dword setting at 0 instead of 1.
Also there are some different instructions for nVidia drivers:
============SNIP SNIP==============
If you have an NVIDIA chipset, the following registry edit should work for you …
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvata]
“DisableRemovable”=dword:00000001
============SNIP SNIP==============
More details on the nVidia drivers here: http://forum-en.msi.com/index.php?action=printpage;topic=99884.0
If you aren’t using these drivers, or it hasn’t worked for you, I can’t offer any more assistance, but at least this is a very good place to start googling from!
For windows XP there is another (better looking) solution:
create a custom .inf file for the device driver.
If the has a driver, simply add the line:
HKR,,NonRemovable,0x00010001,0x00000001
to the addreg section of the device in the inf file of the driver
If it’s a generic usb device (detected as “USB Mass Storage Device” and uses microsoft driver)
you need to create a special .inf driver for it (i name it “usbstrnr.inf”)
YOU HAVE TO REPLACE THE PID and VID N THE FILE FOR YOUR DEVICE!!!!!
;Contels of the file:
;—————————————-begin usbstrnr.inf
[Version]
Signature=”$CHICAGO$”
Class=USB
ClassGUID={36FC9E60-C465-11CF-8056-444553540000}
provider=%MSFT%
LayoutFile=LAYOUT.INF
DriverVer=07/01/2001,5.1.2600.0
[ControlFlags]
ExcludeFromSelect = *
[Manufacturer]
; sorted by VID
%Generic.Mfg%=Generic
[Generic]
%GenericBulkOnly.DeviceDesc%=USBSTOR_BULK, USB\Class_08&SubClass_02&Prot_50
%GenericBulkOnly.DeviceDesc%=USBSTOR_BULK, USB\Class_08&SubClass_05&Prot_50
%GenericBulkOnly.DeviceDesc%=USBSTOR_BULK, USB\Class_08&SubClass_06&Prot_50
;replace the next line with VID&PID of your device!!!
%GenericBulkOnlyNr.DeviceDesc%=USBSTOR_BULK_NR, USB\VID_0CF2&PID_6230
[PreCopySection]
HKR,,NoSetupUI,,1
[DestinationDirs]
USBSTOR.CopyList = 10, system32\drivers
; Bulk-Only Specific Sections
;
[USBSTOR_BULK.NT]
CopyFiles=USBSTOR.CopyList
AddReg=USBSTOR_BULK.AddReg
[USBSTOR_BULK.NT.Services]
Addservice = USBSTOR, 0x00000002, USBSTOR.AddService
; Bulk-Only Non-removable Specific Sections
;
[USBSTOR_BULK_NR.NT]
CopyFiles=USBSTOR.CopyList
AddReg=USBSTOR_BULK.AddReg,USBSTOR_NR.AddReg
[USBSTOR_BULK_NR.NT.Services]
Addservice = USBSTOR, 0x00000002, USBSTOR.AddService
; Registry Sections
;
[USBSTOR_BULK.AddReg]
HKR,,DriverFlags,0x00010001,0x00000001
[USBSTOR_NR.AddReg]
HKR,,NonRemovable,0x00010001,0x00000001
; Common Sections
;
[USBSTOR.AddService]
DisplayName = %USBSTOR.SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\USBSTOR.SYS
; Windows 2000 Copy List Section
;
[USBSTOR.CopyList]
USBSTOR.SYS
[Strings]
MSFT=”Microsoft”
Generic.Mfg = “Compatible USB storage device”
GenericBulkOnly.DeviceDesc = “USB Mass Storage Device”
GenericBulkOnlyNr.DeviceDesc = “Non-removable USB Mass Storage Device”
USBSTOR.SvcDesc = “USB Mass Storage Driver”
;——————————————–end of usbstrnr.inf
Lanthanide’s answer is brilliant, but I don’t have a storage device issue. It’s my NIC (a Broadcom NetLink Gigabit Ethernet internal miniPCI card, most definitely not “removeable”) that appears in “Safely Remove…”
I can’t find a sensible key in the ControlSet\Services hives to govern this device. Anyone have any suggestions to experiment with?
I have discovered a way to remove that icon, which involves the following steps:
1. Download Dud (http://www3.telus.net/_/dud/) and Replacer (http://www3.telus.net/_/replacer/).
2. Rename dud.exe to stobject.dll.
3. Give Ownership of the stobject.dll in \Windows\System32 to Administrators and give Full Permission to it.
4. Run Replacer to replace the original stobject.dll with the renamed dud.exe.
5. Restart the PC.
This is great,, and exactly what I was looking for… but it’s not clear to me how to apply this info to my mounted VHDs.
Hardware IDs:
SCSI\DiskMsft____Virtual_Disk____1.0_
SCSI\DiskMsft____Virtual_Disk____
SCSI\DiskMsft____
SCSI\Msft____Virtual_Disk____1
Msft____Virtual_Disk____1
GenDisk
I thought Device class GUID might be the virtual equivalent.
{4d36e967-e325-11ce-bfc1-08002be10318}
But the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\{4d36e96c-e325-11ce-bfc1-08002be10318} entry has sub-keys that seem to pertain to IntelAudioWaveExtensions…
I can see the capabilities (from devmgmt.sc properties handler, ie details > property:capabilities)
00000064
CM_DEVCAP_REMOVABLE
CM_DEVCAP_SILENTINSTALL
CM_DEVCAP_RAWDEVICEOK
Searched reg for that removable var, but no results (not surprised, as unable to navigate down to capabilities sub-keys in reg, ie HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\{4d36e96c-e325-11ce-bfc1-08002be10318}\*IntAudWaveEx\1&79f5d87&1&06\Properties “cannot be opened” (details: access is denied).
dev inst. path looks familiar
SCSI\DISK&VEN_MSFT&PROD_VIRTUAL_DISK\2&1F4ADFFE&0&000002
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\SCSI\Disk&Ven_Msft&Prod_Virtual_Disk\2&1f4adffe&0&000002 has capabilities! (dec:100)
Think I’ll try this on an empty volume first (not keen on random ‘-4’, ie not fully understanding.. but will try!)
Hi, I stumbled on your post and I tried it on Windows 10.
My tray shows a video capture card and a USB hub as removable devices.
I followed the procedure, which worked for removing the icons from the tray.
Unfortunately the registry “trick” did not survive a reboot though :(
Any ideas anyone?