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

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.
DanBAtkinsonAsked:
Who is Participating?
 
DoTheDEW335Connect With a Mentor Commented:
<<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
 
hitman4hireCommented:
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
DoTheDEW335Commented:
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
 
DanBAtkinsonAuthor Commented:
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
 
DoTheDEW335Commented:
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
 
DanBAtkinsonAuthor Commented:
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
 
DanBAtkinsonAuthor Commented:
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
 
hitman4hireCommented:
Specify device in command line, hope this helps too.

http://support.microsoft.com/kb/87165/EN-US/
0
 
DanBAtkinsonAuthor Commented:
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
 
hitman4hireCommented:
Forgot about that! dos & Xp.
0
 
DanBAtkinsonAuthor Commented:
Any other ideas?
0
 
DanBAtkinsonAuthor Commented:
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
 
DanBAtkinsonAuthor Commented:
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
 
DanBAtkinsonAuthor Commented:
Points are awarded to DoTheDEW335 as it's not his fault that my stupid computer vetoes deveject DeviceEjects!

Thanks for your help!
0
 
DoTheDEW335Commented:
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
All Courses

From novice to tech pro — start learning today.