1

I use the hardware design language VHDL which has the customary file extension .vhd. Win 10 seems to have reserved this extension to mean "virtual hard drive". The displayed Type in File Explorer is "virtual hard drive image". Vhd does thus not appear in the listing of file type associations nor does it allow me to add it. I wish to open these files with Vim or Notepad++. How can I change the .vhd's default program?

1
  • 1
    You use "open with" then manually select the program you wish to use and select the option to always use that program. In order to change the file, the description would require you to modify the registry for the file extension.
    – Ramhound
    Jun 11, 2018 at 14:45

1 Answer 1

1

To add the desired functionality, you can add a context menu (pop-up on right click) only for VHD file. This will not mess with the default VHD (virtual hard disk) program. This approach will be safe because this will not conflict with already present VHD program (e.g. Hyper-V) and can be revert back to its previous state.

First find the path of Notepad++.exe or any text editor you want. Let's assume the path for Notepad++ is "E:\Notepad++\notepad++.exe". Replace this path with any text editor executable you want. Don't miss the double quote if that path contains any space (e.g. C:\Program Files). Now run this following command as administrator:

reg add "HKCR\Windows.VhdFile\shell\Edit with Notepad++\command" /VE /T REG_SZ /D "E:\Notepad++\notepad++.exe \"%1\"" /F 

Here is the details of what this command does. The main program is reg.exe. This add a registry in "HKEY_CLASSES_ROOT\Windows.VhdFile". The Windows.VhdFile is associated file type of .vhd extension. You can get that with this command assoc .vhd. The /VE option will add the registry in default registry value and /F is to suppress the conformation dialog (optional). The backward slash is escape letter. To revert back it's previous stage, you can delete this registry with the following command:

reg delete "HKCR\Windows.VhdFile\shell\Edit with Notepad++" /F 

Further Details:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .