How to check and close a program
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
How to check and close a program
Hi everybody,
In Process tab of Windows Task Manager, we see the available programs that are running. Suppose I've a program "MyProg.exe" is running in process tab but not in applications tab of Windows Task Manager. I want to make a script for a btn to check whether that program is running or not and close if running. Can it be done by kill command? Please, help......
In Process tab of Windows Task Manager, we see the available programs that are running. Suppose I've a program "MyProg.exe" is running in process tab but not in applications tab of Windows Task Manager. I want to make a script for a btn to check whether that program is running or not and close if running. Can it be done by kill command? Please, help......
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
You know, the 'kill' command should only be used as a last resort - as the process that is killed doesn't get a chance to cleanup whatever resources it is locking - and in turn any resources it is connected to may take some time to clear themselves.
So let's see if we can help prevent this situation from happening. What exactly are the circumstances?
- is this a Revolution application that you build yourself and which has become 'faceless' ?
--> see my reply to your previous question "Keep the app always active"
- or are you trying to find a way to stop an executable written by someone else ?
Jan Schenkel.
So let's see if we can help prevent this situation from happening. What exactly are the circumstances?
- is this a Revolution application that you build yourself and which has become 'faceless' ?
--> see my reply to your previous question "Keep the app always active"
- or are you trying to find a way to stop an executable written by someone else ?
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
I'm glad solving my own problem. The "shell" function can be used to kill/close a program from the process tab of windows task manager. For example, in windows XP, a program "MyProg.exe" is running in process tab. To kill that program, the following script can be applied to a button -
Caution: the "taskkill" command is applicable only for windows xp, for the other versions of windows, the command may be different.
Code: Select all
on mouseUp
set the hideconsolewindows to true
get shell("taskkill /f /im MyProg.exe")
end mouseUp
-
- VIP Livecode Opensource Backer
- Posts: 10045
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Tareq, it seems a good many of your posts here are also submitted to the use-rev list, but when answers are provided there you do not see them.
Is there perhaps an issue with your mail filters preventing you from getting the many timely and helpful replies people have been posting for you on the use-rev list?
Is there perhaps an issue with your mail filters preventing you from getting the many timely and helpful replies people have been posting for you on the use-rev list?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn