views:

684

answers:

1

I'm looking to programmatically modify the edit verb for the shell on Vista. For example, I want right click edit (in explorer) to open a .cs file w/ Notepad++.

How do I change a file association on Windows Vista?

Thanks

A: 

You'll need Administrative login for that, since you have to modify HKEY_CLASSES_ROOT. Find the registry key associated with .cs files; you'll find a description like "C# Source Code File" (although probably not that; I'm not on a machine with VS installed right now to check). That key will point you to another one (with MS, it's usually a GUID) which is where the settings for edit, open, and so forth are stored; that's where you'll need to make your changes.

That should get you started, unless Rob guessed wrong and you didn't mean "programmatically modify" in the first place. :-)

Ken White
Thanks Ken, I was able to get this to work by copying the Open key format located in HKEY_CLASSES_ROOT\VisualStudio.cs.9.0\shell\ and create a sibling Edit key.