473,785 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1504
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=Proc ess.GetProcesse s(/* 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.b logspot.com
"Paul Aspinall" <pa**@aspy.co.u k> wrote in message
news:9%******** **********@fe3. news.blueyonder .co.uk...
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=Proc ess.GetProcesse s(/* 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.b logspot.com
"Paul Aspinall" <pa**@aspy.co.u k> wrote in message
news:9%******** **********@fe3. news.blueyonder .co.uk...
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
2401
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 threading.Thread as the base class. Then I create objects of this class and call their start() methods in a loop. The program works fine when run locally in a shell. The problem starts
5
15068
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
4285
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. Unfortunately these ad hominem rhetorts are frequently introduced into purely technical discussions on the feasibility of supporting such functionality in C++. That usually serves to divert the discussion from the technical subject to a discussion of the...
2
3145
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 a pseudorandom number generator. So, rather than calculate the square root to try to get a particular precision answer, you would calculate it to x number of bits. This particular function takes a radicand and the number of iterations as...
15
4896
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
13776
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 information from remote machine." though my network connection is perfect and "XYZ" is my remote computers full computer name. I tried the same with IP address and even then it is failing. Same code works fine if the IP or computer name is local. ...
2
2271
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 "free" process to assign some work too. I'm not sure if the way I'm doing it is the best way to do this, I didn't see any type of IsActive call on the process object.
5
1776
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 traverse through the array looking for the Process name. Is there a shortcut or easier way to accomplish this?
1
2896
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 of time. Is there a way to either specify a timeout on a command such as ssh_connect or alternatively is there a command to check if a certain port (22 in my case) is accepting connections. Then it's a simple matter of using if then to execute...
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10087
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8971
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
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 we have to send another system

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.