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. Process Filename

Process Filename

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

    how do i get the filename of a process?I know how to get the list of processes on a local machine, but i'd like to know how to get the full path (i.e: c:\windows\system32\svchost.exe) of a process.

    N 1 Reply Last reply
    0
    • C CyberKewl

      how do i get the filename of a process?I know how to get the list of processes on a local machine, but i'd like to know how to get the full path (i.e: c:\windows\system32\svchost.exe) of a process.

      N Offline
      N Offline
      Nnamdi Onyeyiri
      wrote on last edited by
      #2

      you can use the Process.GetProcessesByName or Process.GetProcesses to get a Process object. You can then use the MainModule property to get a ProcessModule object for the process, and the ProcessModule has a FileName property that gives a full path to the processes .exe (etc.)

      1001111111011101111100111100101011110011110100101110010011010010
      Sonork | 100.21142 | TheEclypse

      C 1 Reply Last reply
      0
      • N Nnamdi Onyeyiri

        you can use the Process.GetProcessesByName or Process.GetProcesses to get a Process object. You can then use the MainModule property to get a ProcessModule object for the process, and the ProcessModule has a FileName property that gives a full path to the processes .exe (etc.)

        1001111111011101111100111100101011110011110100101110010011010010
        Sonork | 100.21142 | TheEclypse

        C Offline
        C Offline
        CyberKewl
        wrote on last edited by
        #3

        I got it now, thanks!

        N 1 Reply Last reply
        0
        • C CyberKewl

          I got it now, thanks!

          N Offline
          N Offline
          Nnamdi Onyeyiri
          wrote on last edited by
          #4

          no problem. :)

          1001111111011101111100111100101011110011110100101110010011010010
          Sonork | 100.21142 | TheEclypse

          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