From: bob123 on 10 Apr 2010 08:03 Hi, Is it possible to kill a thread in VBS ? How can I do that ? Thanks in advance
From: Pegasus [MVP] on 10 Apr 2010 11:34 "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 10 Apr 2010 12:12 > 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 10 Apr 2010 15:16 | 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 11 Apr 2010 02:19
> > 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 ? |