From: bob123 on
Hi,

Is it possible to kill a thread in VBS ?
How can I do that ?

Thanks in advance




From: Pegasus [MVP] on


"bob123" <bob123(a)gmail.com> wrote in message
news:4bc06914$0$10467$426a74cc(a)news.free.fr...
> Hi,
>
> Is it possible to kill a thread in VBS ?
> How can I do that ?
>
> Thanks in advance
>

Have a look here:
How Can I Close a Command Window with a Specific Title?
http://blogs.technet.com/heyscriptingguy/archive/2005/11/30/how-can-i-close-a-command-window-with-a-specific-title.aspx

From: bob123 on
> Have a look here:
> How Can I Close a Command Window with a Specific Title?
> http://blogs.technet.com/heyscriptingguy/archive/2005/11/30/how-can-i-close-a-command-window-with-a-specific-title.aspx
Thanks
but it is actually a thread inside a process
I know the thread ID, how can I kill it ?


From: Mayayana on
| Thanks
| but it is actually a thread inside a process
| I know the thread ID, how can I kill it ?
|

There's TerminateThread, but like TerminateProcess,
there's almost never a good reason to use it. If you
look up the docs you'll see that it's actually potentially
worse -- it leaves no chance for cleanup and in some
cases could have adverse effects on other processes.

It's also an API function, not a script call. Maybe
you should explain what you're actually trying to
accomplish. It's hard to imagine any reason for anyone
to be picking off threads inside a running process,
much less a script.


From: bob123 on
>
> There's TerminateThread, but like TerminateProcess,
> there's almost never a good reason to use it. If you
> look up the docs you'll see that it's actually potentially
> worse -- it leaves no chance for cleanup and in some
> cases could have adverse effects on other processes.
>
> It's also an API function, not a script call. Maybe
> you should explain what you're actually trying to
> accomplish. It's hard to imagine any reason for anyone
> to be picking off threads inside a running process,
> much less a script.

OK thanks Mayayana
I know it's a dangerous thing but I need It ...
I am very interested in Terminate Thread
Can you show me how I can use it ?