VB and VBA Users Source Code: Terminate a application/process by shelling kill.exe
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Terminate a application/process by shelling kill.exe
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Friday, February 09, 2001
Hits:
4065
Category:
Visual Basic General
Article:
The easiest way to terminate an application that has stopped responding, without using API calls, is by Shelling Kill, eg: Shell kill -f excel.exe, vbHide 'Will bring down Excel Note: Press Windows Key + R then type "kill -f excel.exe" to perform the same task. An API version of this code can be found at: http://www.vbusers.com/code/codeget.asp?ThreadID=109&PostID=1&NumReplies=0 If Kill.exe is not in a mapped directory then either specify the path to the file, or copy the file into your windows directory. Kill.exe is likely to be in a path similiar to "C:\WINNT\CUSTOM\Bin\". Failing this you can download the Kill.exe from: http://www.vbusers.com/downloads/kill.zip (Save this file in a mapped path eg. you WINNT directory) usage: KILL [options] <
|
> [options]: -f Force process kill
This is the process id for the task to be killed. Use TLIST to get a valid pid
The pattern can be a complete task name or a regular expression pattern to use as a match. Kill matches the supplied pattern against the task names and the window titles.
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder