Ghost21 Posted October 10, 2007 Share Posted October 10, 2007 Without using an external program I would like to End a Process on a Remote Computer... No I'm not looking at it for evil Use.. So far I have all the code done to get all the process from the remote pc and show them in a nice little window. But if I need to end a program for IT purpose or Administrative need I would like to do so without using an external program eg. PSkill ...If someone doesn't want to post the code in the General Fourm . Could somoene send it to me via a private message... Or at least point me in the right direction of codming such a beast and I will code it ... Thanks Link to comment Share on other sites More sharing options...
Nahuel Posted October 10, 2007 Share Posted October 10, 2007 And how exactly are you getting the processes from the remote computer? Using the TCP functions? Link to comment Share on other sites More sharing options...
Ghost21 Posted October 10, 2007 Author Share Posted October 10, 2007 And how exactly are you getting the processes from the remote computer? Using the TCP functions?Yeah with the winmgmts service.. I have Admin rights on all the pcs etc.. Link to comment Share on other sites More sharing options...
Nahuel Posted October 10, 2007 Share Posted October 10, 2007 (edited) I suppose you could do something like this: Use this script in the remote computer: ;Server Script. RUN FIRST TCPStartUp() $MainSocket = TCPListen(TCPNameToIP(@computername), 65432, 100 ) If $MainSocket = -1 Then Exit While 1 $ConnectedSocket = TCPAccept( $MainSocket) If $ConnectedSocket >= 0 Then msgbox(0,"","connected",1) ExitLoop EndIf Wend While 1 $KillProcess=TCPRecv($ConnectedSocket,2048) Sleep(25) If $KillProcess<>"" Then ProcessClose($KillProcess) EndIf WEndoÝ÷ Ø ÝºÇ+(ê'Ê«r©º×«jëh×6;Client Script. RUN SERVER FIRST TCPStartUp() $ServerIp="xx.x.x.x.xx";Enter your remote comp's IP here $MainSocket=TCPConnect($ServerIp, 65432) If $MainSocket = -1 Then Exit msgbox(0,"","connected",1) While 1 $ProcessToKill=InputBox("","Enter full name of process to kill in remote comp") if @error Then Exit TCPSend($MainSocket,$ProcessToKill) WEnd Just an idea... Edited October 10, 2007 by Nahuel Link to comment Share on other sites More sharing options...
weaponx Posted October 10, 2007 Share Posted October 10, 2007 (edited) EDIT - Didn't read entire first post Edited October 10, 2007 by weaponx Link to comment Share on other sites More sharing options...
Ghost21 Posted October 10, 2007 Author Share Posted October 10, 2007 I suppose you could do something like this: Use this script in the remote computer: ;Server Script. RUN FIRST TCPStartUp() $MainSocket = TCPListen(TCPNameToIP(@computername), 65432, 100 ) If $MainSocket = -1 Then Exit While 1 $ConnectedSocket = TCPAccept( $MainSocket) If $ConnectedSocket >= 0 Then msgbox(0,"","connected",1) ExitLoop EndIf Wend While 1 $KillProcess=TCPRecv($ConnectedSocket,2048) Sleep(25) If $KillProcess<>"" Then ProcessClose($KillProcess) EndIf WEndoÝ÷ Ø ÝºÇ+(ê'Ê«r©º×«jëh×6;Client Script. RUN SERVER FIRST TCPStartUp() $ServerIp="xx.x.x.x.xx";Enter your remote comp's IP here $MainSocket=TCPConnect($ServerIp, 65432) If $MainSocket = -1 Then Exit msgbox(0,"","connected",1) While 1 $ProcessToKill=InputBox("","Enter full name of process to kill in remote comp") if @error Then Exit TCPSend($MainSocket,$ProcessToKill) WEnd Just an idea... Yeah that's a great Idea but then I have to have another program running on the remote pc... I was thinking something more like this strProcess = "excel.exe" strComputer = "." Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\" & strComputer & " ootcimv2") Set colProcessList = objWMIService.ExecQuery _ ("SELECT * FROM Win32_Process WHERE Name = '" & strProcess & "'") For Each objProcess in colProcessList objProcess.Terminate() Next Link to comment Share on other sites More sharing options...
Ghost21 Posted October 10, 2007 Author Share Posted October 10, 2007 Yeah that's a great Idea but then I have to have another program running on the remote pc...I was thinking something more like thisstrProcess = "excel.exe"strComputer = "."Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\" & strComputer & " ootcimv2")Set colProcessList = objWMIService.ExecQuery _ ("SELECT * FROM Win32_Process WHERE Name = '" & strProcess & "'")For Each objProcess in colProcessList objProcess.Terminate()NextWell I'm I got the CODE TO WORK!! oh baby it is good...One second its there the next second gone... Link to comment Share on other sites More sharing options...
Nahuel Posted October 10, 2007 Share Posted October 10, 2007 Well I'm I got the CODE TO WORK!! oh baby it is good...One second its there the next second gone...me no entiende Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now