473,473 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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.
Feb 2 '06 #1
3 1060
"_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

"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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Laura Conrad | last post by:
I'm writing an application that has to spawn some processes and then kill them later. It doesn't need to talk or listen to them while they're running, but there are stop and start buttons and the...
10
by: Jacek Popławski | last post by:
Hello. I am going to write python script which will read python command from socket, run it and return some values back to socket. My problem is, that I need some timeout. I need to say for...
2
by: Stu | last post by:
Hi, I have an asp.net page that lists all running processes on the server using the script below: Dim p As Process For Each p In Process.GetProcesses sb.Append(p.ProcessName)...
39
by: clintonG | last post by:
This is not about starting a fight but an observation that seems to be proving itself on its own merit and is therefore simply a point of conjecture. I did not get serious about writing software...
6
by: laststubborn | last post by:
Hi everybody, We have a very large database and high transaction volume. Time to time these transactions are locking each other and decrease the performance of the database. Is there any way...
4
by: Miro | last post by:
I'm using VB.Net 2003 I have code - it works great - to kill a process(s) if they are running. ---- Dim myProcesses() As Process 'Funny - withouth the () in the myProcesses it does not work...
2
vdraceil
by: vdraceil | last post by:
Hi everyone,i'm using vb6.0. How do i find all the processes running at a particular instant? Can i stop those processes?Thanx in advance..
6
by: Roger Heathcote | last post by:
sjdevnull@yahoo.com wrote: <snip> Fair point, but for sub processes that need to be in close contact with the original app, or very small functions that you'd like 100s or 1000s of it seems...
3
by: eeriehunk | last post by:
Hi All, I am a little confused between a session and a process. I learnt that an Oracle Session is created for every login. And we can run many processes in one session. I have also learnt how to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.