Welcome Guest.   Make a donation to an author on the site July 29, 2010, 03:49:10 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Free DonationCoder.com Member Kit: Submit Request.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: IDEA: kill specified programs "harshly/silently" at shutdown  (Read 10395 times)
mouser
First Author
Administrator
*****
Posts: 24,001



plarker mouser see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: December 30, 2007, 03:53:55 PM »

I have a wifi tray tool for my computer which does not shutdown gracefully at windows shutdown..
You know the type, windows display the "waiting for shutdown.. end now" progress bar that goes on forever.
I know this isn't the first time i've had a program like this.

So i'm thinking about a little utility where the user can specify the names of processes that should be KILLED when the shutdown signal is received.

I'll write this if it doesn't already exist and no one else wants to write it, but i thought i'd post it here first and see if anyone else wants to do it (ps 1+ day left before NANY 2008 deadline).
« Last Edit: January 02, 2008, 05:50:04 PM by mouser » Logged
rjbull
Charter Member
***
Posts: 1,603

View Profile Give some DonationCredits to this forum member
« Reply #1 on: December 30, 2007, 04:22:22 PM »

Quote

    *Absurd Terminator*

    http://www.nesoft.org/terminator.shtml

    Absurd Terminator - fast Windows Shutdowner and Task Terminator. It helps
    you to make some "absurdly" long and routine Windows functions quicker and
    more convenient.  $17.00.

    Main features:

        - Shutdown/Restart/Log off Windows'95/98/ME/2000 with help of hot keys
    or by one click on system tray icon or from command line, (using:
    terminator.exe /shutdown /restart /logoff - for .bat-files or for
    schedulers and planers);
        - Terminate any running program, task or process quicker and more
    comfortable than in the standard <Ctrl-Alt-Del> function of Windows,
    without confirmation;
        - Terminate programs from command line, syntax: terminator.exe /kill
    [NameOfProgram], where NameOfProgram can be part of the program executable
    file string,

You can kill programs both via GUI and command line with a very small free (6K) program called Taskill

Also:

Quote

Shutdown v1.02  FREE!

http://www.rjlsoftware.co...oftware/utility/shutdown/

This program can be setup to shutdown, logoff, turn off or restart a user's machine. Very easy to use and distribute, no is installation required. By default (with no command line options), Shutdown will simply shutdown Windows. With the command line options, you can manipulate the functionality of this program. There is NO user interface for this program, when you run shutdown, it will execute the commands passed.

This utility works well in combination with our Message Manager Deluxe login script utility. Click here to download Shutdown v1.02 .

Command line options for Shutdown:

SHUTDOWN.EXE {command option} {force}

Pass the option you wish to perform on the command line.

1 = Shuts down the system to a point at which it is safe to turn off the power. All file buffers have been flushed to disk, and all running processes have stopped.
2 = Shuts down all processes running and then it logs the user off.
3 = Shuts down the system and turns off the power. NOTE: the system must support the power-off feature.
4 = Shuts down the system and then restarts the system.

FORCE = Forces processes to terminate. Instead of bringing up the "application not responding" dialog box for the user, this value forces an application to terminate if it does not respond.

Logged
mouser
First Author
Administrator
*****
Posts: 24,001



plarker mouser see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: December 30, 2007, 04:28:40 PM »

there are a lot of shutdown tools that will trigger a shutdown in dif ways, at specific times, etc.

but i'm more interested in a program that kicks in whenever windows is shutdown or restarted the normal way, and then does its work.  programs actually get a signal when shutdown is occuring, so it wouldn't be hard to catch this signal and then kill the programs in the list.

Logged
rjbull
Charter Member
***
Posts: 1,603

View Profile Give some DonationCredits to this forum member
« Reply #3 on: December 30, 2007, 04:38:04 PM »

programs actually get a signal when shutdown is occuring, so it wouldn't be hard to catch this signal and then kill the programs in the list.

Does that mean it's possible and worthwhile to make a more general program, one that could trigger a backup when it sees the shutdown signal, for example?


Logged
mouser
First Author
Administrator
*****
Posts: 24,001



plarker mouser see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: December 30, 2007, 04:40:23 PM »

it's certainly possible to do this.. whether there are other complications with stopping a shutdown to do this i don't know.
Logged
f0dder
Charter Honorary Member
***
Posts: 6,839



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: December 30, 2007, 04:43:05 PM »

Humm, should be easy to code - trap the shutdown signal, then TerminateProcess on the processes in the list. Too bad if any of them have open (for write) files, though...
Logged

- carpe noctem
doublewitt
Participant
*
Posts: 78


View Profile Give some DonationCredits to this forum member
« Reply #6 on: December 30, 2007, 04:48:33 PM »

In another post, here, I talked about KillProcess. This application (free) can kill viciously at shutdown. You simply enable the computer shutdown from within the application. You can also setup any number of "kill lists" for quick & mean execution! - just like the name says. This is a very good APP, give it a try... you'll see...

"KillProcess can "Kill" the Windows Operating System, in an more powerful manner than that of standard Windows. KillProcess will force all applications to terminate, and if an application doesn't respond, it will be terminated instantly."
« Last Edit: December 30, 2007, 05:28:10 PM by doublewitt » Logged
mouser
First Author
Administrator
*****
Posts: 24,001



plarker mouser see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: December 30, 2007, 04:53:48 PM »

yeah but i do not want to have to use the programs shutdown command, i want this to trigger whenever the system restarts or shutdsdown no matter how.

Quote
Too bad if any of them have open (for write) files, though...
you would only use this on programs that are known to be safe to do this for.
(if you wanted you could let it wait a few seconds for it to shutdown nicely and only then send harsh terminate signal).
Logged
f0dder
Charter Honorary Member
***
Posts: 6,839



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: December 30, 2007, 04:59:12 PM »

(if you wanted you could let it wait a few seconds for it to shutdown nicely and only then send harsh terminate signal).
Windows already does this and you can tweak the delay, but obviously you don't want to set it too low, or you could end up with bad stuff happening. And I guess the apps you're annoyed with will always require a full timeout.
Logged

- carpe noctem
jgpaiva
Global Moderator
*****
Posts: 4,174



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: January 02, 2008, 11:51:06 AM »

Well.. Since no one found the solution for this, here it is:
As of version 1.0, it just kills all the programs on the list, without trying to close them before.
Run once to create the sample ini, then modify it and run again.


KillProcesses v1.0 created 02-01-08:
Quote
kill a list of processes when the computer shuts down
[Forum Topic] [.ahk Version] [.exe version]
Logged

mouser
First Author
Administrator
*****
Posts: 24,001



plarker mouser see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: January 02, 2008, 12:33:10 PM »

Fantastic  Kiss Kiss Kiss Kiss
I'll test and report.
The only thing i'd love to request extra is to be able to set a delay before it starts killing the processes.  So i can set it to wait for 5 seconds or so before doing the terminations.. just to give these programs a chance to gracefully shut themselves down.
Logged
jgpaiva
Global Moderator
*****
Posts: 4,174



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: January 02, 2008, 12:43:59 PM »

Fantastic  Kiss Kiss Kiss Kiss
I'll test and report.
The only thing i'd love to request extra is to be able to set a delay before it starts killing the processes.  So i can set it to wait for 5 seconds or so before doing the terminations.. just to give these programs a chance to gracefully shut themselves down.

That's quite simple. Right now it pops a message box before it starts the killing. as long as you don't press "ok", it won't kill anything smiley
Logged

mouser
First Author
Administrator
*****
Posts: 24,001



plarker mouser see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: January 02, 2008, 12:50:56 PM »

id rather swap the message box for a timer without a message box.
oh and just to make sure -- this program should not trigger the killing if it's just me manually exiting it.  it should only trigger at system shutdown.
Logged
jgpaiva
Global Moderator
*****
Posts: 4,174



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: January 02, 2008, 12:56:49 PM »

id rather swap the message box for a timer without a message box.
Ok, shouldn't be hard to add.

oh and just to make sure -- this program should not trigger the killing if it's just me manually exiting it.  it should only trigger at system shutdown.
Yep, it already works like that smiley
Logged

jgpaiva
Global Moderator
*****
Posts: 4,174



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: January 02, 2008, 01:40:11 PM »

Ok, shouldn't be hard to add.
Done smiley
And i added an about box Wink


KillProcesses v1.1 modified 02-01-08:
Quote
kill a list of processes when the computer shuts down
[Forum Topic] [.ahk Version] [.exe version]
Logged

mouser
First Author
Administrator
*****
Posts: 24,001



plarker mouser see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: January 02, 2008, 01:54:56 PM »

GREAT STUFF  Thmbsup
Logged
jgpaiva
Global Moderator
*****
Posts: 4,174



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: January 02, 2008, 02:27:52 PM »

Oh, just something that i forgot to mention:

It kills all running instances of the listed processes. (if you have iexplore.exe on the list, it'll kill all open internet explorer windows)
Logged

CodeTRUCKER
Supporting Member
**
Posts: 711



Most exciting thing about flying?........ LANDING!

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #17 on: January 02, 2008, 03:02:09 PM »

Why couldn't this be an added feature to Process Tamer?
« Last Edit: May 12, 2009, 10:07:54 PM by CodeTRUCKER » Logged

Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is also not a static, but a living entity and will always perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.
mouser
First Author
Administrator
*****
Posts: 24,001



plarker mouser see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: January 02, 2008, 03:10:01 PM »

Quote
Why couldn't this be an added feature to Process Tamer?

that is quite a good idea really.
since i really want to keep PT tiny and free of extra features people don't need, it poses a bit of a problem.
however, i think maybe the solution is: plugins for Process Tamer.
i have stuff i'm working on for the next couple of months but when i finish i may consider this.

jgp -> KillProcesses did not work for me.  didn't kill the processes.
i think it would really help if there was a menu item called "kill processes now" so we could test it.

btw just so we are clear -- it's not sufficient to send these processes a message requesting that they close, since that's what windows does already.  they need to be forced to die.

an alternative option to trying to kill it from the ahk script would be for us to use an existing commandline process killer and just have the ahk script invoke it.
Logged
jgpaiva
Global Moderator
*****
Posts: 4,174



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #19 on: January 02, 2008, 03:13:37 PM »

Mouser: did any info appear in the tray? (like "killing the following processes: processA.exe processB.exe")?

I added the "kill now" option.

[edit]updated the script[/edit]
« Last Edit: January 02, 2008, 03:18:34 PM by jgpaiva » Logged

mouser
First Author
Administrator
*****
Posts: 24,001



plarker mouser see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #20 on: January 02, 2008, 03:27:41 PM »

nothing appeared in tray..

the new version killed it successfully when i tried to exit.
(ps you didnt add a menu item to kill now in tray, you changed it so it kills if you exit it from the tray -- make sure to change that).

--

is it possible that the situation is more difficult than i thought, and that windows tries to shutdown programs SEQUENTIALLY, and so that if it tries to close the stuck program before it gets to yours, yours will never even be called?  Sad
Logged
f0dder
Charter Honorary Member
***
Posts: 6,839



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #21 on: January 02, 2008, 03:31:51 PM »

is it possible that the situation is more difficult than i thought, and that windows tries to shutdown programs SEQUENTIALLY, and so that if it tries to close the stuck program before it gets to yours, yours will never even be called?  Sad

Sounds very likely - doh that I didn't think about this :/
Logged

- carpe noctem
mouser
First Author
Administrator
*****
Posts: 24,001



plarker mouser see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #22 on: January 02, 2008, 03:32:46 PM »

yeah i didn't think about it either..
makes the problem a little more interesting doesn't it..  but it also makes it a little nicer if someone can figure out a solution.
Logged
jgpaiva
Global Moderator
*****
Posts: 4,174



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #23 on: January 02, 2008, 03:36:27 PM »

(ps you didnt add a menu item to kill now in tray, you changed it so it kills if you exit it from the tray -- make sure to change that).
I added another menu item that "simulates" the shutdown sequence having started, but kept the "exit" option that doesn't kill anything.

is it possible that the situation is more difficult than i thought, and that windows tries to shutdown programs SEQUENTIALLY, and so that if it tries to close the stuck program before it gets to yours, yours will never even be called?  Sad
Yes, that apparently is the problem. If it didn't show any balloon, it means the executable wasn't running when killprocesses tried to kill it...

Would there be any way to have a process have its "shutdown priority" raised? I sure haven't seen such a thing anywhere Sad
Logged

f0dder
Charter Honorary Member
***
Posts: 6,839



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #24 on: January 02, 2008, 03:40:53 PM »

I wonder which parameter the shutdown is "sorted" by... probably just the order processes appear in a ToolHelp32 snapshot, which is probably based on the PID?
Logged

- carpe noctem
Pages: [1] 2   Go Up
  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
SMF © 2006-2009, Simple Machines LLC

social bookmark this page