Skip to content

Custom run command by extension ​

All above instruction need to be in the same file with .reg extension.

First we need to setup the rules on .something ​

powershell
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.something]
@="mycustomcommand"

Then we need to setup the custom command ​

powershell
[HKEY_CLASSES_ROOT\mycustomcommand.something]
@="Open with my custom command"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\mycustomcommand.something\DefaultIcon]
@="<CustomFile>.exe"

[HKEY_CLASSES_ROOT\mycustomcommand.something\shell]
[HKEY_CLASSES_ROOT\mycustomcommand.something\shell\open]
"Icon"="<EXAMPLE_FOLER>\\<CustomFile>.exe,0"
; or .ico "Icon"="\"<EXAMPLE_FOLER>\\<CustomFile>.ico\""

[HKEY_CLASSES_ROOT\mycustomcommand.something\shell\open\command]
@="cmd.exe /K \"rez env something -- something\" %1"

Final example with openRV ​

powershell
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.exr]
@="ORV.exr"

[HKEY_CLASSES_ROOT\ORV.exr]
@="Open file with openRV"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\ORV.exr\DefaultIcon]
@="cmd.exe"

[HKEY_CLASSES_ROOT\ORV.exr\shell]
[HKEY_CLASSES_ROOT\ORV.exr\shell\open]
@="Open with OpenRV"
"Icon"="cmd.exe,0"
; or .ico "Icon"="\"<EXAMPLE_FOLER>\\<CustomFile>.ico\""

[HKEY_CLASSES_ROOT\ORV.exr\shell\open\command]
@="cmd /K \"rez env aces openRv -- rv\" %1"