2

I wanted to create my own file extension and set two actions possible to do with the file.

Here is .reg file I created:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.dls\]
@="DLSource"

[HKEY_CLASSES_ROOT\.dls\ShellNew]
"FileName"="source.dls"
"NullFile"="source.dls"

[HKEY_LOCAL_MACHINE\Software\Classes\DLSource\shell\]


[HKEY_LOCAL_MACHINE\Software\Classes\DLSource\shell\Open in DLI\command]
@="C:\\dl\\DLI.exe \"%1\""

[HKEY_LOCAL_MACHINE\Software\Classes\DLSource\DefaultIcon]
@="c:\\dl\\fav.ico"

[HKEY_LOCAL_MACHINE\Software\Classes\DLSource\shell\Compile with DLC\command]
@="C:\\dl\\DLC.exe \"%1\""

It works correctly, but Compile with DLC is default and is higher in context menu than Open in DLI. I want to set it oppositely, I suppose that now it's sorted alphabetical. Here is pic how it is now: Now

1 Answer 1

2
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.dls]
@="DLSource"

[HKEY_CLASSES_ROOT\.dls\ShellNew]
"FileName"="source.dls"
"NullFile"="source.dls"

[HKEY_CLASSES_ROOT\DLSource\DefaultIcon]
@="c:\\dl\\fav.ico"

[HKEY_CLASSES_ROOT\DLSource\shell]
@="OpeninDLI"

[HKEY_CLASSES_ROOT\DLSource\shell\CompilewithDLC]
@="Compile with DLC"

[HKEY_CLASSES_ROOT\DLSource\shell\CompilewithDLC\command]
@="C:\\dl\\DLC.exe \"%1\""

[HKEY_CLASSES_ROOT\DLSource\shell\OpeninDLI]
@="Open in DLI"

[HKEY_CLASSES_ROOT\DLSource\shell\OpeninDLI\command]
@="C:\\dl\\DLI.exe \"%1\""

Don't use spaces in the shell\commandname keys. Instead of shell\Compile with DLC and shell\Open in DLI use shell\CompilewithDLC and shell\OpeninDLI, and set their (Default) values to the actual strings you want to display.

To specify the default action set the ProgID\shell key's (Default) value to the appropriate command sub-key. So in this case you need to set the (Default) value of DLSource\shell to OpeninDLI.

As an alternative to directly editing the registry consider using something like FileTypesMan instead.

0

You must log in to answer this question.

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