index > Visual C# General > Exe path from file extension

Exe path from file extension

Any way in the framework to get the .exe file path from a particular extension?

TIA

Dr Clocker

You will have to look at the registry under HKEY_CLASSES_ROOT and then examine the keys under the extension.I would suggest that you open regedit for example,expand the HKEY_CLASSES_ROOT and look for .sln.There you will find a subkey called OpenWithList and where you will find devenv.exe.

Here is a bit of code that helps you associate an extension with a program.You can use this and it makes very interesting reading

http://www.mentalis.org/soft/class.qpx?id=5

Karthik Krishnaswami

The registry value for .sln seems to be : VisualStudio.Launcher.sln

I need to get the Program exe name and path of associated extensions.

Dr Clocker

Since you??e already found how to find the name of the handler for the given file type, you next would need to locate that handler, also within HKEY_CLASSES_ROOT where for the .sln file you have found the name to be VisualStudio.Launcher.sln, you should see a key by the name of Shell, which itself contains an Open key which in turn contains Command that has the default value of the path to the executable and any necessary arguments.

Does that get you closer?




Please visit http://www.brendansstudentloans.com to help me pay off my student loans a little faster
Brendan Grant

I used to do this in VB with psapi.dll...

Can't locate the code tho.

Dr Clocker
reply 5

You can use google to search for other answers

 

More Articles

• MemberwiseClone of a MarshalByRefObject
• OOP Data Access Question
• How to store a TreeView state and restore it back
• C# SQL and ASP
• Chinese words in DataGrid
• Encrypting (Appended) text file
• Dynamically changing an image!
• System.Web.HttpUtility
• Unable to add an identical cell to a row twice
• Issues with service uninstallation
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• 2005 .item() & .Select() replacements?
• How can I launch my another managed exec
• Problems with GUID
• ListView - Second Question
• Read from html file
• Where is the Visual C# Express free down
• Rename the App_code.dll generated by .Ne
• Obtaining the Messages of Another Applic
• MSDN Library for VS.NET 2003 download
• Sum the value of Radio Button Lists
• How to invoke a form class from differen
• FTP Login Failed
• CheckedListbox in C# 2005
• activedirectory log files
• Is there a transaction object for writin

Hot Articles

• Reading AssemblyInfo
• Difference between DLL and TypeLibrary
• Error with toolbar (when reinstall Cryst
• c#+sql
• How to create a C# DLL?
• Invoke a WebService automatically (using
• What is a Hashtable?
• direct sound question
• logout button
• constantly update of file time modified
• Calling Synchronous Methods Asynchronous
• Problem with my GUI when i start a progr
• Samba share security.
• Bind to a private member variable of my
• Handling exceptions with GetDirectories(

Recommend Articles

• security que
• Retrieving Lists of Services
• Using SqlConnection.Open repeatedly
• Using TLS on LdapConneciton
• creating event handlers at runtime
• simple editor using webBrowser control
• assembly version problem
• Adding controls to a windows from from XML
• Bind folder structure to a Treeview
• Windows Media Player
• Sending mail with C#
• Saving Toolbar State to Registry?
• Why A Blank Record In Database?
• Use of classes in windows c# programming
• GetRequestStream() throwing SocketExcept