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. Want to know path of .exe file

Want to know path of .exe file

Scheduled Pinned Locked Moved C#
comquestion
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.
  • P Offline
    P Offline
    pitnu
    wrote on last edited by
    #1

    i want to know the path where this .exe located. ofcourse most of user set path c:/program file and the software's folder. but if it is else where then what ? so i want to know location of exe and then start that exe using Process.strat. Thanks Prakash Paghdal (prakash_paghdal@hotmail.com)

    R D B 3 Replies Last reply
    0
    • P pitnu

      i want to know the path where this .exe located. ofcourse most of user set path c:/program file and the software's folder. but if it is else where then what ? so i want to know location of exe and then start that exe using Process.strat. Thanks Prakash Paghdal (prakash_paghdal@hotmail.com)

      R Offline
      R Offline
      rakesh_nits
      wrote on last edited by
      #2

      Hi Prakash, If I got it right ,then you are probably talking about the path set by the user for installing a software in this case your .exe.you will get the location of all the assemblies being installed by the program under the HKLM\SOFTWARE\Classes\Installer\Assemblies registry key.Iterate through all the keys and check whether the name of any subkey ends with "app.exe" where app.exe is the name of your .exe file.The seperator used in the name will be "|" .so don't forget to replace it with "\".Hope it Helps. Rakesh

      1 Reply Last reply
      0
      • P pitnu

        i want to know the path where this .exe located. ofcourse most of user set path c:/program file and the software's folder. but if it is else where then what ? so i want to know location of exe and then start that exe using Process.strat. Thanks Prakash Paghdal (prakash_paghdal@hotmail.com)

        D Offline
        D Offline
        dnewmon
        wrote on last edited by
        #3

        I have one thing to say: System.Windows.Forms.Application.ExecutablePath

        1 Reply Last reply
        0
        • P pitnu

          i want to know the path where this .exe located. ofcourse most of user set path c:/program file and the software's folder. but if it is else where then what ? so i want to know location of exe and then start that exe using Process.strat. Thanks Prakash Paghdal (prakash_paghdal@hotmail.com)

          B Offline
          B Offline
          Bassam Saoud
          wrote on last edited by
          #4

          You can also use System.Reflection.Assembly.GetExecutingAssembly().Location or GetName().CodeBase

          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