please microsoft or anyone tell me why !!!????

when i debug this code

Process p=process.getAllprocessbyName(processName,RemoteMachineName);

p.Kill();

i have this exeption

this feature is not supported in remote machine

what i want to say is why microsoft make this function and told us that we can use it for remote machinr

in msdn help i found:

C#
public static Process[] GetProcessesByName (
	string processName,
	string machineName
)
Parameters
processName The friendly name of the process.
machineName The name of a computer on the network.




Answer this question

please microsoft or anyone tell me why !!!????

  • Laura Bagnall

    As i said before and Greg Young says in his last reply, it can be done with WMI.


  • salvatore

    I thought you get the execption in the GetProcessByName method, but indeed you can't kill a process on a other machine with the Process class.

    Is the process that runs on the ochter machine a process that is developed by yourself


  • Scraniel

    Here is a working example written in C++, but it couldn't be hard to convert only the End Process of this example.

    I don't know but meybe you can use WMI to kill a remote process, you can create on with WMI.


  • csexpert

    Google for "Process.Kill" - the first result is the MSDN documentation for Process.Kill(), which states:

    "You can call Kill and CloseMainWindow only for processes that are running on the local computer. You cannot cause processes on remote computers to exit."


    So, alas, you cannot do it.


  • dozaone

    Do you get this exception with every remote PC or just one The exception message is very clear.


  • MauiSon

    I have all permission I am member of administrators

    frankly I do not want  use
    client server application is there another way

     



  • TaffyDownUnder

    the process in the other pc which i try to kill it it is a calc

    I lost hope to find the solution

    note:is there any chance to resolve it



  • glw

    yes my dear

    I tried to test my code in domain between two computers

    after that i tried to test it in workgroup with no benefit



  • Melissa_Janet

    PJ. van de Sande wrote:
    I don't know if you can run other processes on that machine, but you can make a extra application that you run on the remote machine and with a simple UDP Package you give the information to kill a specific process on the machine

    A method similar to what PJ suggests is already available here http://www.codeguru.com/csharp/csharp/cs_network/remoting/article.php/c6037/ (uses remoting).

    Cheers,

    Greg


  • drtom

    You have to deal with security issues, and I believe that the call uses WMI underneath anyway, so it's basically a WMI call.

    Is your account valid on the systems you're trying to access Are you an administrator on them



  • gpja

    I don't know if you can run other processes on that machine, but you can make a extra application that you run on the remote machine and with a simple UDP Package you give the information to kill a specific process on the machine


  • grcor

    wow I apologize.

    http://www.codeproject.com/csharp/WMI.asp contains code that can do this through WMI.

    Cheers,

    Greg


  • Mridu

    Thanks for anyone shared to solve my problem

    I respect every responses



  • please microsoft or anyone tell me why !!!????