Jump to content

vhdmount - change Umount context menu to Drive


reboot12

Recommended Posts

Default Mount/Umount command context menu is for VHD files. I want change Umount command from file VHD to mounted Drive like this:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Drive\shell\Umount VHD]

[HKEY_CLASSES_ROOT\Drive\shell\Umount VHD\command]
@="C:\\Program Files\\VHD Mount\\vhdmount.exe /u all"

but this not working :-(

If manually run this command in cmd this working good and umount all mounted images VHD. What's going on? Why this not working from Drive context menu?

Edited by Maniek
Link to comment
Share on other sites


Take another look at the syntax for REG entries in the link. You're "missing" some characters...

Yes, syntax is other but after fix still not working:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Drive\shell\Umount VHD\command]
@="\"C:\\Program Files\\VHD Mount\\vhdmount.exe\" /u \"%1\""

Link to comment
Share on other sites

Mount and Umount from link working good. Now I want only move Umount command to Drive key. Default to umount VHD image need right-click on VHD image. I want right-click to icon drive in My Computer window to umount VHD not for VHD file.

I try also option /u all but it did not work :-( from right-click icon drive. Only working in cmd.

post-374863-0-16758700-1368888531_thumb.

Edited by Maniek
Link to comment
Share on other sites

That will probably require some kind of Script to detect the Drive Letter plus trace back to the VHD file. The VHDMOUNT doesn't do that directly. Several "steps" would be necessary -

/q - Displays the disk name of the mounted virtual disk device for the specified VHDFileName.

VHDMOUNT /q VHDFileName | All

"All" then a loop-through of the List "compare to Drive Letter" since the VHDFileName is unknown. :unsure:

Here is the source Article of your link above -

http://technet.microsoft.com/en-us/library/cc708295%28v=ws.10%29.aspx

Returns the disk identifier of the mounted virtual disk device for the specified VHDFileName, or on all mounted virtual disk devices. VHDFileName is the fully qualified path of the .vhd file.

...and I guess you mean "Drive Letter" and not "Drive Key"...

No time to Install, Build a Script, and Test the "Theory" right now. Maybe some other Script Experts here can help you out. One might "assume" that the information must be stored somewhere. :unsure:

In which case, this Topic is in the wrong Sub-Forum and should be under the Scripting one...

Maybe here - http://www.msfn.org/board/forum/66-programming-c-delphi-vbvbs-cmdbatch-etc/

Edited by submix8c
Link to comment
Share on other sites

That will probably require some kind of Script to detect the Drive Letter plus trace back to the VHD file.

Maybe you right but why in cmd working command:

vhdmount /u all

It does not need to specify the drive letter to umount image VHD. This umount automatic all mounted images.

Link to comment
Share on other sites

It undoubtedly keeps a LIST somewhere (I said that) and loops through ALL of them. That is EXACTLY why I said a Script may be necessary to get a SPECIFIC one.

Why does it work that way? That's how MS wrote it... Two "options" a SPECIFIC.VHD or "All"...

Edited by submix8c
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...