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 can i get the root folder for my program after setup

how can i get the root folder for my program after setup

Scheduled Pinned Locked Moved C#
questionworkspacehelptutorial
3 Posts 2 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.
  • A Offline
    A Offline
    ahmedhassan96
    wrote on last edited by
    #1

    hi every body i want know how can i get the path of the folder which the program start from it after install example the default directory for any program is : c:\program files\*****\**** but user may change this path to any another path my question is how can i get this path i have tried (Environment.CurrentDirectory); but it didn`t work it returned by (My documents path) any body can help me ??

    D 1 Reply Last reply
    0
    • A ahmedhassan96

      hi every body i want know how can i get the path of the folder which the program start from it after install example the default directory for any program is : c:\program files\*****\**** but user may change this path to any another path my question is how can i get this path i have tried (Environment.CurrentDirectory); but it didn`t work it returned by (My documents path) any body can help me ??

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      Application.StartupPath works under most situations. Environment.CurrentDirectory only gets the current working directory - nothing to do with the application itself.

      Dave
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Expect everything to be hard and then enjoy the things that come easy. (code-frog)

      A 1 Reply Last reply
      0
      • D DaveyM69

        Application.StartupPath works under most situations. Environment.CurrentDirectory only gets the current working directory - nothing to do with the application itself.

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Expect everything to be hard and then enjoy the things that come easy. (code-frog)

        A Offline
        A Offline
        ahmedhassan96
        wrote on last edited by
        #3

        thank you davey it`s worked with me

        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