Sign in to follow this  
Followers 0
Ghost21

Process Kill !

8 posts in this topic

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

Share this post


Link to post
Share on other sites

And how exactly are you getting the processes from the remote computer? Using the TCP functions?

Share this post


Link to post
Share on other sites

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..

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Nahuel

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

EDIT - Didn't read entire first post

Edited by weaponx

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Well I'm I got the CODE TO WORK!! oh baby it is good...

One second its there the next second gone...

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0