Identifying and killing processes

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

    #1

    Identifying and killing processes


    I want to create a program that can iterate through active processes and
    shut down certain applications that are running on a system. I need to
    ensure that these processes are not left running overnight and I can't trust
    users to do that. As long as I'm in there, I would also like to close all
    explorer windows for certain folders.


    This is something I've never attempted and I'd appreciate some advice on
    where to start. Any suggestions? TIA,


    Ralf
    --
    --
    ----------------------------------------------------------
    * ^~^ ^~^ *
    * _ {~ ~} {~ ~} _ *
    * /_``>*< >*<''_\ *
    * (\--_)++) (++(_--/) *
    ----------------------------------------------------------
    There are no advanced students in Aikido - there are only
    competent beginners. There are no advanced techniques -
    only the correct application of basic principles.


  • Herfried K. Wagner [MVP]

    #2
    Re: Identifying and killing processes

    "_AnonCowar d" <abcdef@uvwxyz. com> schrieb:[color=blue]
    > I want to create a program that can iterate through active processes and
    > shut down certain applications that are running on a system. I need to
    > ensure that these processes are not left running overnight and I can't
    > trust
    > users to do that. As long as I'm in there, I would also like to close all
    > explorer windows for certain folders.[/color]

    Check out 'System.Diagnos tics.Process' and its properties and shared
    methods.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • _AnonCoward

      #3
      Re: Identifying and killing processes


      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
      news:%23rUhRhAK GHA.744@TK2MSFT NGP09.phx.gbl.. .
      : "_AnonCowar d" <abcdef@uvwxyz. com> schrieb:
      : > I want to create a program that can iterate through active processes and
      : > shut down certain applications that are running on a system. I need to
      : > ensure that these processes are not left running overnight and I can't
      : > trust users to do that. As long as I'm in there, I would also like to
      : > close all explorer windows for certain folders.
      :
      : Check out 'System.Diagnos tics.Process' and its properties and shared
      : methods.
      :
      : --
      : M S Herfried K. Wagner
      : M V P <URL:http://dotnet.mvps.org/>
      : V B <URL:http://classicvb.org/petition/>


      Thanx, will do.


      Ralf
      --
      --
      ----------------------------------------------------------
      * ^~^ ^~^ *
      * _ {~ ~} {~ ~} _ *
      * /_``>*< >*<''_\ *
      * (\--_)++) (++(_--/) *
      ----------------------------------------------------------
      There are no advanced students in Aikido - there are only
      competent beginners. There are no advanced techniques -
      only the correct application of basic principles.


      Comment

      • _AnonCoward

        #4
        Re: Identifying and killing processes


        "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
        news:%23rUhRhAK GHA.744@TK2MSFT NGP09.phx.gbl.. .
        :
        : "_AnonCowar d" <abcdef@uvwxyz. com> schrieb:
        :
        : > I want to create a program that can iterate through active processes and
        : > shut down certain applications that are running on a system. I need to
        : > ensure that these processes are not left running overnight and I can't
        : > trust users to do that. As long as I'm in there, I would also like to
        : > close all explorer windows for certain folders.
        :
        : Check out 'System.Diagnos tics.Process' and its properties and shared
        : methods.
        :
        : --
        : M S Herfried K. Wagner
        : M V P <URL:http://dotnet.mvps.org/>
        : V B <URL:http://classicvb.org/petition/>


        That was pretty straight forward and not nearly as complicated as I had
        expected. I knocked it out in about an hour. The only thing I can't figure
        out how to do is shut down the explorer windows. I want to shut down all
        such windows *except* the desktop.

        Any way to figure out how best to go about that? I suppose I could identify
        all the explorer windows and shut down all but the one with the smallest PID
        value, but that assumes that the desktop instance will always have the
        smallest PID value and I'm not sure that is a reasonable assumption.

        And it brings another thought to mind. Should I want to actually see what
        folder a given explorer window is pointing to, how would I go about that?
        This isn't an actual need on my part but it seems like it could be a useful
        thing to know how to do in the future (say, I want to close explorer windows
        pointing to certain network shares or something).

        Thanx,


        Ralf


        Comment

        Working...