Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 04, 2016, 08:17:24 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: IDEA: kill specified programs "harshly/silently" at shutdown  (Read 22664 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
IDEA: kill specified programs "harshly/silently" at shutdown
« 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 »

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 2,925
    • View Profile
    • Donate to Member
Re: IDEA: list of programs to "harshly/silently" kill at shutdown
« 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.rjlsoftwa...re/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.


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: list of programs to "harshly/silently" kill at shutdown
« 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.


rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 2,925
    • View Profile
    • Donate to Member
Re: IDEA: list of programs to "harshly/silently" kill at shutdown
« 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?



mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: list of programs to "harshly/silently" kill at shutdown
« 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.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: IDEA: list of programs to "harshly/silently" kill at shutdown
« 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...
- carpe noctem

doublewitt

  • Participant
  • Joined in 2006
  • *
  • Posts: 78
    • View Profile
    • Donate to Member
Re: IDEA: list of programs to "harshly/silently" kill at shutdown
« 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 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: list of programs to "harshly/silently" kill at shutdown
« 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).

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: IDEA: list of programs to "harshly/silently" kill at shutdown
« 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.
- carpe noctem

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: list of programs to "harshly/silently" kill at shutdown
« 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]

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« Reply #10 on: January 02, 2008, 12:33:10 PM »
Fantastic  :-* :-* :-* :-*
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.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« Reply #11 on: January 02, 2008, 12:43:59 PM »
Fantastic  :-* :-* :-* :-*
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 :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« 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.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« 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 :)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« Reply #14 on: January 02, 2008, 01:40:11 PM »
Ok, shouldn't be hard to add.
Done :)
And i added an about box ;)


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

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« Reply #15 on: January 02, 2008, 01:54:56 PM »
GREAT STUFF  :Thmbsup:

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« 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)

CodeTRUCKER

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,060
    • View Profile
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« 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, 11:07:54 PM by CodeTRUCKER »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« 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.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« 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 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« 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?  :(

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« 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?  :(

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

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« 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.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« 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?  :(
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 :(

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« 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?
- carpe noctem