By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,143 Members | 1,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,143 IT Pros & Developers. It's quick & easy.

Identifying and killing processes

P: n/a

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.
Feb 2 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"_AnonCoward" <ab****@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.Diagnostics.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/>

Feb 2 '06 #2

P: n/a

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
: "_AnonCoward" <ab****@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.Diagnostics.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.
Feb 2 '06 #3

P: n/a

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
:
: "_AnonCoward" <ab****@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.Diagnostics.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
Feb 4 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.