Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to retrive the excutions file of a MimeType?

how to retrive the excutions file of a MimeType?

Scheduled Pinned Locked Moved C#
tutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    leeoze 0
    wrote on last edited by
    #1

    HI, In My application I need to retrive the excution file for a given mimetype. i.e. I have "Smaple.doc" So I retrive it's MimeType by "doc" extention and now I'm missing the way to retrive the actual excution file of the mimeType (in this example it should be "winword.exe". Any ideas on how to do so? it doesn't have to be the same way I'm thinking of doing it, as long as the in string is a given file name ("xxx.doc") and out is the excution file ("winword.exe"). tnx

    modified on Saturday, December 13, 2008 6:19 AM

    L G 2 Replies Last reply
    0
    • L leeoze 0

      HI, In My application I need to retrive the excution file for a given mimetype. i.e. I have "Smaple.doc" So I retrive it's MimeType by "doc" extention and now I'm missing the way to retrive the actual excution file of the mimeType (in this example it should be "winword.exe". Any ideas on how to do so? it doesn't have to be the same way I'm thinking of doing it, as long as the in string is a given file name ("xxx.doc") and out is the excution file ("winword.exe"). tnx

      modified on Saturday, December 13, 2008 6:19 AM

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Are you sure you need to know the exe? if you execute Process.Start("xxx.doc") it will launch whatever exe is associated with the .doc extension (probably winword.exe), as if you double-clicked the file in Windows Explorer. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      Fixturized forever. :confused:


      1 Reply Last reply
      0
      • L leeoze 0

        HI, In My application I need to retrive the excution file for a given mimetype. i.e. I have "Smaple.doc" So I retrive it's MimeType by "doc" extention and now I'm missing the way to retrive the actual excution file of the mimeType (in this example it should be "winword.exe". Any ideas on how to do so? it doesn't have to be the same way I'm thinking of doing it, as long as the in string is a given file name ("xxx.doc") and out is the excution file ("winword.exe"). tnx

        modified on Saturday, December 13, 2008 6:19 AM

        G Offline
        G Offline
        Giorgi Dalakishvili
        wrote on last edited by
        #3

        Hello, As Luc has told you if the only thing you need is to launch the application associated with doc file, you can use Process class. On the other hand if you really need to retrieve application path then you will need to use various methods for reading windows registry as the information is stored in system registry.

        Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion

        L 1 Reply Last reply
        0
        • G Giorgi Dalakishvili

          Hello, As Luc has told you if the only thing you need is to launch the application associated with doc file, you can use Process class. On the other hand if you really need to retrieve application path then you will need to use various methods for reading windows registry as the information is stored in system registry.

          Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion

          L Offline
          L Offline
          leeoze 0
          wrote on last edited by
          #4

          Anyhow I found the answer my self already. It's all in the registry. in order to retrive which application is associated with the extention you need to access the OpenWithList key for the extention. all the extentions are located under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts there you can find your extention and all you need is to open the OpenWithList key i.e. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.doc\OpenWithList in this key you will find DWORD's a,b,c each represent and application to use in order to open this file. "a" is the default.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups