Remote Process Information

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • xla76

    #1

    Remote Process Information

    Using WMI I can get the full path of a process on a remote computer:
    "SELECT ExecutablePath FROM Win32_Process"

    Without wmi I can get theprocessname and id:
    For Each ps In System.Diagnost ics.Process.Get Processes(PC.Na me)
    processgrid.Row s.Add(ps.Proces sName, ps.Id)
    Next ps

    Any ideas how I can get the process path (using vb 2005)

    Thanks,
    Pete.

  • RB

    #2
    Re: Remote Process Information

    xla76 wrote:
    Using WMI I can get the full path of a process on a remote computer:
    "SELECT ExecutablePath FROM Win32_Process"
    >
    Without wmi I can get theprocessname and id:
    For Each ps In System.Diagnost ics.Process.Get Processes(PC.Na me)
    processgrid.Row s.Add(ps.Proces sName, ps.Id)
    Next ps
    >
    Any ideas how I can get the process path (using vb 2005)
    >
    Thanks,
    Pete.
    >
    I think ps.StartInfo.Fi leName returns the full path.

    HTH,

    RB.

    Comment

    • xla76

      #3
      Re: Remote Process Information

      On Sep 19, 12:03 pm, RB <owmdkbqziki... @mailinator.com wrote:
      xla76 wrote:
      Using WMI I can get the full path of a process on a remote computer:
      "SELECT ExecutablePath FROM Win32_Process"
      >
      Without wmi I can get theprocessname and id:
      For Each ps In System.Diagnost ics.Process.Get Processes(PC.Na me)
      processgrid.Row s.Add(ps.Proces sName, ps.Id)
      Next ps
      >
      Any ideas how I can get the process path (using vb 2005)
      >
      Thanks,
      Pete.
      >
      I think ps.StartInfo.Fi leName returns the full path.
      >
      HTH,
      >
      RB.
      I tried that, but it only returned a bunch of zero length strings.

      Comment

      • RB

        #4
        Re: Remote Process Information

        xla76 wrote:
        On Sep 19, 12:03 pm, RB <owmdkbqziki... @mailinator.com wrote:
        >xla76 wrote:
        >>Using WMI I can get the full path of a process on a remote computer:
        >> "SELECT ExecutablePath FROM Win32_Process"
        >>Without wmi I can get theprocessname and id:
        >> For Each ps In System.Diagnost ics.Process.Get Processes(PC.Na me)
        >> processgrid.Row s.Add(ps.Proces sName, ps.Id)
        >> Next ps
        >>Any ideas how I can get the process path (using vb 2005)
        >>Thanks,
        >>Pete.
        >I think ps.StartInfo.Fi leName returns the full path.
        >>
        >HTH,
        >>
        >RB.
        >
        I tried that, but it only returned a bunch of zero length strings.
        >
        Okey dokey,

        Have you tried ps.MainModule.F ileName?

        (http://msdn2.microsoft.com/en-us/lib...e_members.aspx)

        Cheers,

        RB.

        Comment

        • xla76

          #5
          Re: Remote Process Information

          On 19 Sep, 14:34, RB <owmdkbqziki... @mailinator.com wrote:
          xla76 wrote:
          On Sep 19, 12:03 pm, RB <owmdkbqziki... @mailinator.com wrote:
          xla76 wrote:
          >Using WMI I can get the full path of a process on a remote computer:
          > "SELECT ExecutablePath FROM Win32_Process"
          >Without wmi I can get theprocessname and id:
          > For Each ps In System.Diagnost ics.Process.Get Processes(PC.Na me)
          > processgrid.Row s.Add(ps.Proces sName, ps.Id)
          > Next ps
          >Any ideas how I can get the process path (using vb 2005)
          >Thanks,
          >Pete.
          I think ps.StartInfo.Fi leName returns the full path.
          >
          HTH,
          >
          RB.
          >
          I tried that, but it only returned a bunch of zero length strings.
          >
          Okey dokey,
          >
          Have you tried ps.MainModule.F ileName?
          >
          (http://msdn2.microsoft.com/en-us/lib...tics.processmo...)
          >
          Cheers,
          >
          RB.
          I Tried it but got: feature is not supported for remote machines!

          Comment

          • xla76

            #6
            Re: Remote Process Information

            On Sep 19, 4:12 pm, xla76 <xla...@gmail.c omwrote:
            On 19 Sep, 14:34, RB <owmdkbqziki... @mailinator.com wrote:
            >
            >
            >
            xla76 wrote:
            On Sep 19, 12:03 pm, RB <owmdkbqziki... @mailinator.com wrote:
            >xla76 wrote:
            >>Using WMI I can get the full path of a process on a remote computer:
            >> "SELECT ExecutablePath FROM Win32_Process"
            >>Without wmi I can get theprocessname and id:
            >> For Each ps In System.Diagnost ics.Process.Get Processes(PC.Na me)
            >> processgrid.Row s.Add(ps.Proces sName, ps.Id)
            >> Next ps
            >>Any ideas how I can get the process path (using vb 2005)
            >>Thanks,
            >>Pete.
            >I think ps.StartInfo.Fi leName returns the full path.
            >
            >HTH,
            >
            >RB.
            >
            I tried that, but it only returned a bunch of zero length strings.
            >
            Okey dokey,
            >
            Have you tried ps.MainModule.F ileName?
            >>
            Cheers,
            >
            RB.
            >
            I Tried it but got: feature is not supported for remote machines!
            So, back to WMI then?

            Comment

            • RB

              #7
              Re: Remote Process Information

              xla76 wrote:
              On Sep 19, 4:12 pm, xla76 <xla...@gmail.c omwrote:
              >On 19 Sep, 14:34, RB <owmdkbqziki... @mailinator.com wrote:
              >>
              >>
              >>
              >>xla76 wrote:
              >>>On Sep 19, 12:03 pm, RB <owmdkbqziki... @mailinator.com wrote:
              >>>>xla76 wrote:
              >>>>>Using WMI I can get the full path of a process on a remote computer:
              >>>>> "SELECT ExecutablePath FROM Win32_Process"
              >>>>>Without wmi I can get theprocessname and id:
              >>>>> For Each ps In System.Diagnost ics.Process.Get Processes(PC.Na me)
              >>>>> processgrid.Row s.Add(ps.Proces sName, ps.Id)
              >>>>> Next ps
              >>>>>Any ideas how I can get the process path (using vb 2005)
              >>>>>Thanks,
              >>>>>Pete.
              >>>>I think ps.StartInfo.Fi leName returns the full path.
              >>>>HTH,
              >>>>RB.
              >>>I tried that, but it only returned a bunch of zero length strings.
              >>Okey dokey,
              >>Have you tried ps.MainModule.F ileName?
              >>(http://msdn2.microsoft.com/en-us/lib...tics.processmo...)
              >>Cheers,
              >>RB.
              >I Tried it but got: feature is not supported for remote machines!
              >
              So, back to WMI then?
              >
              The only other suggestion I can think of is to create a service on the
              remote machine that would report back the list of processes running on
              the remote machine.

              Actually, that would be quite cool - you could make it a web-service and
              then query it from any computer through a web-based interface as well as
              from your application :-) Um - don't know if that's what you want though!!

              Cheers,

              RB.

              Comment

              • Peter Forman

                #8
                Re: Remote Process Information

                On Sep 21, 10:48 am, RB <owmdkbqziki... @mailinator.com wrote:
                xla76 wrote:
                On Sep 19, 4:12 pm, xla76 <xla...@gmail.c omwrote:
                On 19 Sep, 14:34, RB <owmdkbqziki... @mailinator.com wrote:
                >
                >xla76 wrote:
                >>On Sep 19, 12:03 pm, RB <owmdkbqziki... @mailinator.com wrote:
                >>>xla76 wrote:
                >>>>Using WMI I can get the full path of a process on a remote computer:
                >>>> "SELECT ExecutablePath FROM Win32_Process"
                >>>>Without wmi I can get theprocessname and id:
                >>>> For Each ps In System.Diagnost ics.Process.Get Processes(PC.Na me)
                >>>> processgrid.Row s.Add(ps.Proces sName, ps.Id)
                >>>> Next ps
                >>>>Any ideas how I can get the process path (using vb 2005)
                >>>>Thanks,
                >>>>Pete.
                >>>I think ps.StartInfo.Fi leName returns the full path.
                >>>HTH,
                >>>RB.
                >>I tried that, but it only returned a bunch of zero length strings.
                >Okey dokey,
                >Have you tried ps.MainModule.F ileName?
                >(http://msdn2.microsoft.com/en-us/lib...tics.processmo...)
                >Cheers,
                >RB.
                I Tried it but got: feature is not supported for remote machines!
                >
                So, back to WMI then?
                >
                The only other suggestion I can think of is to create a service on the
                remote machine that would report back the list of processes running on
                the remote machine.
                >
                Actually, that would be quite cool - you could make it a web-service and
                then query it from any computer through a web-based interface as well as
                from your application :-) Um - don't know if that's what you want though!!
                >
                Cheers,
                >
                RB.
                Thanks for your efforts RB, but I just wanted a method of reading/
                controlling processes as and when required, so a service would be
                overkill (and over my head at the minute - though I will look into it
                at some stage).

                Regards
                Pete

                Comment

                Working...