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. Getting Absolute path of windows service

Getting Absolute path of windows service

Scheduled Pinned Locked Moved C#
csharphelpquestion
4 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.
  • E Offline
    E Offline
    EvilInide
    wrote on last edited by
    #1

    hi I am newbie in c# windows serives. I have successfully created and install mywindows service. But I faced problem while retrieve absolute path of mywindows service, from next c# - program. how can i achieve this. Any suggestion, related links are highly grateful. Evil Inside

    L 1 Reply Last reply
    0
    • E EvilInide

      hi I am newbie in c# windows serives. I have successfully created and install mywindows service. But I faced problem while retrieve absolute path of mywindows service, from next c# - program. how can i achieve this. Any suggestion, related links are highly grateful. Evil Inside

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

      One way to get it is by calling Environment.CommandLine

      Luc Pattyn [My Articles] [Forum Guidelines]

      E 1 Reply Last reply
      0
      • L Luc Pattyn

        One way to get it is by calling Environment.CommandLine

        Luc Pattyn [My Articles] [Forum Guidelines]

        E Offline
        E Offline
        EvilInide
        wrote on last edited by
        #3

        can u give any more information evil inside

        L 1 Reply Last reply
        0
        • E EvilInide

          can u give any more information evil inside

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

          MSDN on Environment.CommandLine states: This property provides access to the program name and any arguments specified on the command line when the current process was started. Unfortunately it also says: The program name can include path information, but is not required to do so. You may be better of using the Assembly class, maybe it is: Assembly.GetExecutingAssembly().Location :)

          Luc Pattyn [My Articles] [Forum Guidelines]

          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