How do I put a command on the right click menu for a file type?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In all the other versions of Windows, you can add and edit options that
appear on the right click menu when you click on a given file type by going
to Folder Options -> File Types. I can't find a way to do this in Vista.

You can select the default program to run after selecting Open With...., but
that doesn't help me much. What if I want to add an option like
unregistering a DLL. To register it, I can tell it to open with
Regsvr32.exe. But to unregister it, I need to add the /u switch on the end,
so I need to use a command.

I can't believe they would remove this option from Windows, but I have
searched everywhere and can't find any way to do it in Vista.

Thanks.
 
DJR

Here is a workaround for you.

You can add an option to the right click context menu to register and
unregister DLL and OCX files. Copy the text between the first dashed lines
and paste it into Notepad. Save the file as regdll.reg.

Double click the file to merge it into the registry.

This will add a Register and Unregister item to the right click context
menu, when you select a DLL file.

Perform the same steps for the text between the second 2 lines. Name this
file regocx.reg. This will add the same context menu items when you right
click an ocx file.
------------------------------------------------------------------------
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\dllfile\Shell]
[HKEY_CLASSES_ROOT\dllfile\Shell\Register]
[HKEY_CLASSES_ROOT\dllfile\Shell\Register\command]
@="regsvr32.exe \\\"%1\\\""
[HKEY_CLASSES_ROOT\dllfile\Shell\UnRegister]
[HKEY_CLASSES_ROOT\dllfile\Shell\UnRegister\command]
@="regsvr32.exe /u \\\"%1\\\""

-----------------------------------------------------------------------

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ocxfile\Shell]
[HKEY_CLASSES_ROOT\ocxfile\Shell\Register]
[HKEY_CLASSES_ROOT\ocxfile\Shell\Register\command]
@="regsvr32.exe \\\"%1\\\""
[HKEY_CLASSES_ROOT\ocxfile\Shell\UnRegister]
[HKEY_CLASSES_ROOT\ocxfile\Shell\UnRegister\command]
@="regsvr32.exe /u \\\"%1\\\""
---------------------------------------------------------------------
 
Ronnie -

Thanks for the info, but this still does not work for me. I ran the reg
file and it said it ran successfully. I went into regedit to confirm and the
entries are just as they should be in the paths as defined in the file. But
I still get no additional options on the menu when right clicking a dll.
Just the same Open and Open with... and the other standard stuff. I
restarted to be sure, but still no difference. Any guesses what the problem
is?

Assuming I can figure out what is up, can I assume this should work for any
extension by running regxxx.reg where xxx is the file extension I want to add
the options for? I have found several other cases where I can't open a file
as I would like to with Vista's features.

Just out of curiousity, any idea why they would take away that functionality
from previous versions to just let you go in and add these options in the
Folder Options section? Seems like a pretty essential and basic function
they've removed.

Thanks for your help,

Doug

Ronnie Vernon MVP said:
DJR

Here is a workaround for you.

You can add an option to the right click context menu to register and
unregister DLL and OCX files. Copy the text between the first dashed lines
and paste it into Notepad. Save the file as regdll.reg.

Double click the file to merge it into the registry.

This will add a Register and Unregister item to the right click context
menu, when you select a DLL file.

Perform the same steps for the text between the second 2 lines. Name this
file regocx.reg. This will add the same context menu items when you right
click an ocx file.
------------------------------------------------------------------------
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\dllfile\Shell]
[HKEY_CLASSES_ROOT\dllfile\Shell\Register]
[HKEY_CLASSES_ROOT\dllfile\Shell\Register\command]
@="regsvr32.exe \\\"%1\\\""
[HKEY_CLASSES_ROOT\dllfile\Shell\UnRegister]
[HKEY_CLASSES_ROOT\dllfile\Shell\UnRegister\command]
@="regsvr32.exe /u \\\"%1\\\""

-----------------------------------------------------------------------

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ocxfile\Shell]
[HKEY_CLASSES_ROOT\ocxfile\Shell\Register]
[HKEY_CLASSES_ROOT\ocxfile\Shell\Register\command]
@="regsvr32.exe \\\"%1\\\""
[HKEY_CLASSES_ROOT\ocxfile\Shell\UnRegister]
[HKEY_CLASSES_ROOT\ocxfile\Shell\UnRegister\command]
@="regsvr32.exe /u \\\"%1\\\""
---------------------------------------------------------------------
--

Ronnie Vernon
Microsoft MVP
Windows Shell/User


DJR said:
In all the other versions of Windows, you can add and edit options that
appear on the right click menu when you click on a given file type by
going
to Folder Options -> File Types. I can't find a way to do this in Vista.

You can select the default program to run after selecting Open With....,
but
that doesn't help me much. What if I want to add an option like
unregistering a DLL. To register it, I can tell it to open with
Regsvr32.exe. But to unregister it, I need to add the /u switch on the
end,
so I need to use a command.

I can't believe they would remove this option from Windows, but I have
searched everywhere and can't find any way to do it in Vista.

Thanks.
 
DJR

That is strange, I have been using these right click options for quiet
awhile and never had a problem?

The 'Register' and 'Unregister' menu items should appear at the top of the
right click menu when used on a .dll or .ocx file.

I attached my ocxfile and dllfile registry keys to this message (renamed
with the .txt extension) for comparison to your registry keys.

To answer your second question, yes, you can tweak these files to add other
file menu items. All of the standard registry warnings apply, backup any
keys before applying changes to those keys. Also, make sure you have a very
current system restore point.

--

Ronnie Vernon
Microsoft MVP
Windows Shell/User


DJR said:
Ronnie -

Thanks for the info, but this still does not work for me. I ran the reg
file and it said it ran successfully. I went into regedit to confirm and
the
entries are just as they should be in the paths as defined in the file.
But
I still get no additional options on the menu when right clicking a dll.
Just the same Open and Open with... and the other standard stuff. I
restarted to be sure, but still no difference. Any guesses what the
problem
is?

Assuming I can figure out what is up, can I assume this should work for
any
extension by running regxxx.reg where xxx is the file extension I want to
add
the options for? I have found several other cases where I can't open a
file
as I would like to with Vista's features.

Just out of curiousity, any idea why they would take away that
functionality
from previous versions to just let you go in and add these options in the
Folder Options section? Seems like a pretty essential and basic function
they've removed.

Thanks for your help,

Doug

Ronnie Vernon MVP said:
DJR

Here is a workaround for you.

You can add an option to the right click context menu to register and
unregister DLL and OCX files. Copy the text between the first dashed
lines
and paste it into Notepad. Save the file as regdll.reg.

Double click the file to merge it into the registry.

This will add a Register and Unregister item to the right click context
menu, when you select a DLL file.

Perform the same steps for the text between the second 2 lines. Name this
file regocx.reg. This will add the same context menu items when you right
click an ocx file.
------------------------------------------------------------------------
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\dllfile\Shell]
[HKEY_CLASSES_ROOT\dllfile\Shell\Register]
[HKEY_CLASSES_ROOT\dllfile\Shell\Register\command]
@="regsvr32.exe \\\"%1\\\""
[HKEY_CLASSES_ROOT\dllfile\Shell\UnRegister]
[HKEY_CLASSES_ROOT\dllfile\Shell\UnRegister\command]
@="regsvr32.exe /u \\\"%1\\\""

-----------------------------------------------------------------------

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ocxfile\Shell]
[HKEY_CLASSES_ROOT\ocxfile\Shell\Register]
[HKEY_CLASSES_ROOT\ocxfile\Shell\Register\command]
@="regsvr32.exe \\\"%1\\\""
[HKEY_CLASSES_ROOT\ocxfile\Shell\UnRegister]
[HKEY_CLASSES_ROOT\ocxfile\Shell\UnRegister\command]
@="regsvr32.exe /u \\\"%1\\\""
---------------------------------------------------------------------
--

Ronnie Vernon
Microsoft MVP
Windows Shell/User


DJR said:
In all the other versions of Windows, you can add and edit options that
appear on the right click menu when you click on a given file type by
going
to Folder Options -> File Types. I can't find a way to do this in
Vista.

You can select the default program to run after selecting Open
With....,
but
that doesn't help me much. What if I want to add an option like
unregistering a DLL. To register it, I can tell it to open with
Regsvr32.exe. But to unregister it, I need to add the /u switch on
the
end,
so I need to use a command.

I can't believe they would remove this option from Windows, but I have
searched everywhere and can't find any way to do it in Vista.

Thanks.
 
Back
Top