473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Checking if certain processes are running, on a certain machine

Hi
I want to write a piece of code, that will check if a particular service is
running on a particular machine.
Can someone give me a pointer as to which classes would be useful??
Any sample code would be appreciated

Thanks
Nov 17 '05 #1
3 1486
Hello Paul,

Just a point (u don't have codesnippet)
http://www.windowsitpro.com/Articles...layTab=Article

U need to use Performance counters

PA> Hi
PA> I want to write a piece of code, that will check if a particular
PA> service is
PA> running on a particular machine.
PA> Can someone give me a pointer as to which classes would be useful??
PA> Any sample code would be appreciated
PA> Thanks
PA>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Nov 17 '05 #2
Salam

you cannot get the information about the process running on the remoate PC,
but for that you must have an admin rights

Process[] arrProcess;

arrProcess=Process.GetProcesses(/* C REMOTE COMPUTER NAME*/);

foreach (Process p in arrProcess)

{

if (p.ProcessName==/* REQUIRED PROCESS NAME*/)

{

// do something

}

}
--
ALI RAZA SHAIKH
MCAD.net

www.programmersparadise.cjb.net
alirazashaikh.blogspot.com
"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:9%******************@fe3.news.blueyonder.co.u k...
Hi
I want to write a piece of code, that will check if a particular service
is running on a particular machine.
Can someone give me a pointer as to which classes would be useful??
Any sample code would be appreciated

Thanks

Nov 17 '05 #3
Salam

you cannot get the information about the process running on the remoate PC,
but for that you must have an admin rights

Process[] arrProcess;

arrProcess=Process.GetProcesses(/* C REMOTE COMPUTER NAME*/);

foreach (Process p in arrProcess)

{

if (p.ProcessName==/* REQUIRED PROCESS NAME*/)

{

// do something

}

}
--
ALI RAZA SHAIKH
MCAD.net

www.programmersparadise.cjb.net
alirazashaikh.blogspot.com
"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:9%******************@fe3.news.blueyonder.co.u k...
Hi
I want to write a piece of code, that will check if a particular service
is running on a particular machine.
Can someone give me a pointer as to which classes would be useful??
Any sample code would be appreciated

Thanks

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Deepak Sarda | last post by:
Hello everyone. I have run into something which I believe is a bug or a shortcoming of the threading.Thread module. My program spawns 15 threads. For this I've creating a new class with...
5
by: Roger | last post by:
I would like to get a list of running processes on a remote machine. How is this possible via VB.Net? Is it possible? Can someone point me in the right direction. thanks, rog
67
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. ...
2
by: Clint Olsen | last post by:
Hello: I posted a thread on comp.programming awhile back asking about an algorithm I implemented on square root. The idea was to use the square root of a prime number as a convenient way to get...
15
by: Dirk Reske | last post by:
Hello, why doesn't this code work correctly? private int GetCpuUsage(Process proc) { DateTime time1,time2; TimeSpan timediff; double cpu1,cpu2,cpudiff;
1
by: Chidvilas | last post by:
// Get all processes running on the remote computer. Process remoteAll = Process.GetProcesses("XYZ"); when I am exectuing the above code, it is giving excetpion saying "Couldn't get process...
2
by: D | last post by:
I have an array of processes declared like so System.Diagnostics.Process _ProcessArray = new System.Diagnostics.Process; and the code below shows how I iterate thru the array and looking for a...
5
by: kd | last post by:
Hi All, If the name of a process is known, is it possible to check whether it is in execution? What I did was to fetch all the processes running on the system using Process.GetProcesses() and...
1
by: asdf | last post by:
I'm using ssh2_connect to execute a certain command on a group of servers. The problem is that not all of them are necessarily on the network which causes php script to execute for extended periods...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.