?
Solved

Adding a 'Safely remove hardware' option to the context (right click) menu in My Computer

Posted on 2005-03-08
16
Medium Priority
?
3,753 Views
Last Modified: 2009-07-29
Hi there,

I was wondering whether anyone had written a shell extension or other program that added a feature that does the following:

Add a 'Safely remove this device' option when you right click on a removable drive in My Computer. The extension I want would automatically know which device I want to remove when I right click it and not just bring up the 'Safely Remove Hardware' option that can be achieved at the bottom right hand corner of the taskbar.

I really would like to have this option as I am always in Explorer copying files from drive to drive and putting them onto non-networked computers. It would save me a lot of time if I could just go up to My Computer, right click and select 'Safely remove this device' as I generally have 4-6 devices attached at any one time (CD Drives, Printers, modems, USB drives etc).

I'm offering 500 points for this one because I want it THAT much!

If anyone can come up with a quick program (or knows where I can get detailed information on how to create such an extension to the context menu), then I'd appreciate it greatly.
0
Comment
Question by:DanBAtkinson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
  • 4
16 Comments
 
LVL 1

Expert Comment

by:hitman4hire
ID: 13486166
Add a programs to the right click menu

Here's an example adding notepad to the right click menu.

Run REGEDIT.
Navigate to HKEY_CLASSES_ROOT*. (This should be the very first subtree.)
A key called "shellex" should already be here. Add a new key called "Shell" at the same tree level as "shellex."
Under the "Shell" key, create another key called "Notepad."
Create another key under the "Notepad" key called "Command."
You'll see a string value named Default when you highlight the "Command" key. Double-click Default and enter "NOTEPAD %1" (without the quotes). Click OK.
Exit Regedit and test it out.
Note:The full path to the correct Registry key is: HKEY_CLASSES_ROOT*ShellNotepadCommand

ADD WORDPAD TO RIGHT-CLICK MENU FOR EVERY FILE

Run REGEDIT.
Navigate to HKEY_CLASSES_ROOT*. (This should be the very first subtree.)
A key called "shellex" should already be here. Add a new key called "Shell" at the same tree level as "shellex."
Under the "Shell" key, create another key called "Wordpad."
Create another key under the "Wordpad" key called "Command."
You'll see a string value named Default when you highlight the "Command" key. Double-click Default and enter "C:Program FilesAccessoriesWORDPAD.EXE %1" (without the quotes or the appropiate path to wordpad.exe). Click OK.
Exit Regedit and test it out.
Note: The full path to the correct Registry key is: HKEY_CLASSES_ROOT*ShellWordpadCommand

Hope this is what you were looking for. You can go right here for full infomation.

http://searchwinsystems.techtarget.com/tip/1,289483,sid68_gci1039684,00.html




Adding A ShortCut To Desktop In The Right Click Menu
http://www.spreadfirefox.com/?q=node/view/975



0
 
LVL 1

Expert Comment

by:hitman4hire
ID: 13486193
0
 
LVL 11

Expert Comment

by:DoTheDEW335
ID: 13486447
Here is what you want:

This will bring up the GUI:
rundll32.exe shell32.dll,Control_RunDLL hotplug.dll

To automate the job of safely removing a device completely, you can use
deveject.exe available here (includes C++ source code as well):

ftp://ftp.heise.de/pub/ct/listings/0316-208.zip

For help, run deveject.exe /? in a command prompt.

Works for Windows 2000/XP/2003.

If you can intergrate that into the right click menu with the link posted above:
Adding A ShortCut To Desktop In The Right Click Menu
http://www.spreadfirefox.com/?q=node/view/975

It should do what your asking :)

Source:
http://www.codecomments.com/VBScript/message407965.html
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

Author Comment

by:DanBAtkinson
ID: 13486469
Thankyou. I do know how to add shortcuts to the right click menu.

But...

My problem is rather customised. I'm not trying to add a generic program like Notepad to it (which I've already done anyway).

I'm trying to add a 'Safely Remove Device' button which at the very least will require a bit more than a simple registry editing since I require something that is able to remove the specific device that I right clicked on.

Thanks all the same though.
0
 
LVL 11

Expert Comment

by:DoTheDEW335
ID: 13486542
Did you see my post? You can download that file , create a batch file /shortcut to do what your asking then place that shortcut on the right click menu.
0
 

Author Comment

by:DanBAtkinson
ID: 13486595
DoTheDEW335 :

Thanks. That would almost do it. But I would still need to specify the removable device in the command line arguments once it's added to the context menu.

For example if I run this, all I could do is run deveject. I would still need to write in the device drive letter (which can be variable), the PID, which again to my knowledge is variable, and the name of the device (which once again is variable).

Although the source is enclosed, I don't write in C++.

So if anyone is able to give any hints or tips on how to customise it to my problem, I would be very happy.

Thanks again.
0
 

Author Comment

by:DanBAtkinson
ID: 13486613
DoTheDEW335:

No I didn't see your post (or the one after) as I was writing mine whilst you were posting yours!!! If you know how to / can create a batch file to do what would be needed, then I'd be grateful.

Thanks.
0
 
LVL 1

Expert Comment

by:hitman4hire
ID: 13486651
Specify device in command line, hope this helps too.

http://support.microsoft.com/kb/87165/EN-US/
0
 

Author Comment

by:DanBAtkinson
ID: 13486731
No I'm afraid as MSCDEX.EXE relies on command line switches and not batch files. Plus MSCDEX is not included with Win XP.
0
 
LVL 1

Expert Comment

by:hitman4hire
ID: 13486754
Forgot about that! dos & Xp.
0
 

Author Comment

by:DanBAtkinson
ID: 13494936
Any other ideas?
0
 
LVL 11

Accepted Solution

by:
DoTheDEW335 earned 2000 total points
ID: 13497841
<<Thanks. That would almost do it. But I would still need to specify the removable device in the command line arguments once it's added to the context menu>>

You could make a multi menu, just make one menu Eject then off that menu add the drive letters that are vacant in your machine (Like E-L should be plenty far out depending on CD-ROMS and what not)

Batch files:

;(E:)
@echo off
deveject -EjectDrive:E

;(F:)
@echo off
deveject -EjectDrive:F

;(G:)
@echo off
deveject -EjectDrive:G

and so on.... Does that make sense?
0
 

Author Comment

by:DanBAtkinson
ID: 13504787
I get the following error:

Invalid drive specification 'E'!
Usage: c:\deveject -EjectDrive:<Drive>|-EjectName:<Name>|-EjectId:<DeviceId> [-v] [-Debug]
DevEject 1.0  2003 c't/Matthias Withopf

Invalid drive specification 'F'!
Usage: c:\deveject -EjectDrive:<Drive>|-EjectName:<Name>|-EjectId:<DeviceId> [-v] [-Debug]
DevEject 1.0  2003 c't/Matthias Withopf

Invalid drive specification 'G'!
Usage: c:\deveject -EjectDrive:<Drive>|-EjectName:<Name>|-EjectId:<DeviceId> [-v] [-Debug]
DevEject 1.0  2003 c't/Matthias Withopf

Despite that I have removable drives in F and G.
0
 

Author Comment

by:DanBAtkinson
ID: 13505622
I have added the : after the drive letter and it appears to work (although the actual DriveEject is vetoed).

;(E:)
@echo off
deveject -EjectDrive:E:

;(F:)
@echo off
deveject -EjectDrive:F:

;(G:)
@echo off
deveject -EjectDrive:G:
0
 

Author Comment

by:DanBAtkinson
ID: 13505636
Points are awarded to DoTheDEW335 as it's not his fault that my stupid computer vetoes deveject DeviceEjects!

Thanks for your help!
0
 
LVL 11

Expert Comment

by:DoTheDEW335
ID: 13506000
Sorry bout that, I didn't quite test it like I meant to before putting out that information for you.. I am glad you got it. Thank you for the accept!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you unable to synchronize your OST (Offline Storage Table) file with Microsoft Exchange Server? Is your OST file exceeding 2 GB size limit? In Microsoft Outlook 2002 and earlier versions, there is a 2 GB size limit for the OST file. If the file …
If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question