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. Associating Files to a particular exe..

Associating Files to a particular exe..

Scheduled Pinned Locked Moved C#
question
4 Posts 4 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.
  • R Offline
    R Offline
    Rohit Dev
    wrote on last edited by
    #1

    hi all, how can i associate a particular file to an exe... i.e if i doubleclick on a file with a particular extension ia want that file to be opened in a particular exe.. thanks in advance...

    A N RaviBeeR 3 Replies Last reply
    0
    • R Rohit Dev

      hi all, how can i associate a particular file to an exe... i.e if i doubleclick on a file with a particular extension ia want that file to be opened in a particular exe.. thanks in advance...

      A Offline
      A Offline
      Andrei Ungureanu
      wrote on last edited by
      #2

      Hi, There are several ways to associate a file with a particular program. In Windows XP the easiest way is to right click on the file and select Open With -> Choose Program. Select the exe file that you want to open the file with and then click OK (don't forget to select the "Always use the selected program to open this kind of file" checkbox). The operating system associates the file extension with your program and the next time you double click on a file it opens it with your program. Hope it helps.

      Do your best to be the best

      1 Reply Last reply
      0
      • R Rohit Dev

        hi all, how can i associate a particular file to an exe... i.e if i doubleclick on a file with a particular extension ia want that file to be opened in a particular exe.. thanks in advance...

        N Offline
        N Offline
        Nader Elshehabi
        wrote on last edited by
        #3

        Hello This depends on wither the Application is yours or not. If it is your application do this: 1- In your setup: a- Right Click on your setup project's name => View => File Types b- Right Click on "File Types on Target Machine" => Add File Type 2- If you want to associate the filetype with another application that's not yours ignore this step. In your application, use Enironment.GetCommandLineArgs() to get the filename If you want to make an application like a "Filetype associations editor". Edit the registry with it. In the registry, any file extension has a key to associate it with different applications that appear in the Open with... list if there are more than one application associated, and make one of them as default. For example, search your registry using RegEdit for "jpg". It will return all keys including associations with jpg files. Understand the structure and make your application editing all keys with the changes of the extension name. Shouldn't be too hard.

        Regards:rose:

        1 Reply Last reply
        0
        • R Rohit Dev

          hi all, how can i associate a particular file to an exe... i.e if i doubleclick on a file with a particular extension ia want that file to be opened in a particular exe.. thanks in advance...

          RaviBeeR Offline
          RaviBeeR Offline
          RaviBee
          wrote on last edited by
          #4

          See this[^] example project. /ravi

          My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

          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