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. Windows Forms
  4. Windows service

Windows service

Scheduled Pinned Locked Moved Windows Forms
helpquestion
2 Posts 2 Posters 1 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.
  • S Offline
    S Offline
    sirisha guttikonda
    wrote on last edited by
    #1

    hi all.. can any help to find the windows service path..?? i have tried in following 3 ways... but i didn't get it. 1. System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase).Substring(6)); 2. AppDomain.CurrentDomain.SetupInformation.PrivateBinPath); 3. System.Management.ManagementObjectSearcher sor =new System.Management.ManagementObjectSearcher("SELECT PathName FROM Win32_Service WHERE Name =MyWinService" ); foreach (ManagementObject mo in sor.Get()) { strwriter.Write(Path.GetDirectoryName(mo["PathName"].ToString())); } } thank you.

    siri

    M 1 Reply Last reply
    0
    • S sirisha guttikonda

      hi all.. can any help to find the windows service path..?? i have tried in following 3 ways... but i didn't get it. 1. System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase).Substring(6)); 2. AppDomain.CurrentDomain.SetupInformation.PrivateBinPath); 3. System.Management.ManagementObjectSearcher sor =new System.Management.ManagementObjectSearcher("SELECT PathName FROM Win32_Service WHERE Name =MyWinService" ); foreach (ManagementObject mo in sor.Get()) { strwriter.Write(Path.GetDirectoryName(mo["PathName"].ToString())); } } thank you.

      siri

      M Offline
      M Offline
      Muhammad Shahid Farooq
      wrote on last edited by
      #2

      See the following link, this will help you: http://msdn.microsoft.com/en-us/library/aa394418(VS.85).aspx[^]

      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