Robbo, I love it

I have on other occasions asked for this exact routine, without success
(How to kill Excel for example)

Thank you, Thank you
Sytze




On Mon, Jul 20, 2009 at 9:11 PM, Rob Anderson<[email protected]> wrote:
> A quick google search turned up this :-)
>
> lcProcess = "IEXPLORE.EXE"  && Process to be closed
>
> lcComputer = "."
> loWMIService = GETOBJECT("winmgmts:" ;
>               + "{impersonationLevel=impersonate}!\\" + lcComputer +
> "\root\cimv2")
> colProcessList = loWMIService.ExecQuery ("Select * from Win32_Process")
> IF TYPE('colProcessList') = "O"
>   FOR EACH loProcess IN colProcessList
>      IF ALLTRIM(UPPER(loProcess.NAME)) == ALLTRIM(UPPER(lcProcess))
>         loProcess.TERMINATE()
>       ENDIF
>   NEXT
> ENDIF  && IF TYPE('colProcessList') = "O"
> RELEASE colProcessList, loWMIService
>
> HTH,
>
> Robbo.
>
> Rob Anderson | Development Team Leader | Pegasus, an Infor company | Tel:
> +44 (0)1536 495006 | Fax: +44 (0)1536 495214 | Mobile: +44 (0)7917 615401 |
> www.pegasus.co.uk
>
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
> Of Alan Bourke
> Sent: 20 July 2009 10:05
> To: [email protected]
> Subject: Re: VFP9-Close IEXPLORE
>
> Assuming you can guarantee XP Pro or Windows Server 2003 or later, you
> could run the command prompt utility 'tasklist' and pipe it to a CSV
> file:
>
> tasklist /FO CSV > myprocs.csv
>
> You could then get that into a table using APPEND FROM ... CSV
>
> Search the relevant column for IEXPLORE.EXE
>
> If found you could run the command prompt 'taskkill' command:
>
> taskkill /IM iexplore.exe
>
> Although having said all that I'm sure someone will come up with a
> Windows API method of doing all this !
>
>
>
> On Mon, 20 Jul 2009 18:33 +1200, "Sytze de Boer" <[email protected]>
> wrote:
>> I need a method to determine if IEXPLORE is listed as a process in
>> Ttask manager, and if so, kill it
>> Is there an easy way to do so ?
>>
>>
>> --
>> Regards
>> Sytze de Boer
>> Kiss Systems
>> Hamilton, NZ
>> Ph: 64-7-8391670, Mob:021 937611,
>> www.kiss.co.nz
>>
>>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to