Jump to content
Sign in to follow this  
CGAnimator

how to force process to close

Recommended Posts

CGAnimator

i want to close a process , if i used processclose ("name") it's not working

i need to force the process to be closed , like winkill .

thanx in advance

Share this post


Link to post
Share on other sites
Baloven

If it is necessary for you to close process it is necessary to use ProcessClose ("process" [, flag]) where "process" - a name of an executed file (as a rule)...

See <Program Files Dir>\AutoIt3\AutoIt.chm

...

ProcessClose ( "process" [, flag] )

Parameters

process The title or PID of the process to terminate.

flag [optional] if different from zero will force closing of handles to child stream if any defined in the Run() execution. process must be defined as a PID.

Share this post


Link to post
Share on other sites
mikiutama

#include <Constants.au3>

$run = Run("taskkill /F /T /IM processnametokill.exe", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
While 1
    $line = StdoutRead($run)
    If @error Then ExitLoop
    MsgBox(0, "Sucessfull:", $line)
Wend

While 1
    $line = StderrRead($run)
    If @error Then ExitLoop
    MsgBox(0, "Error:", $line)
WEnd

Edited by mikiutama

Share this post


Link to post
Share on other sites
CGAnimator

Thanx alot Baloven for the advice

thanx alot mikiutama for the new way it works fine

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  

×