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 10, 2016, 04:58:35 AM
  • 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 22673 times)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« Reply #25 on: January 02, 2008, 03:51:45 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?
If so, the program only needs to be started before the anoying processes to solve the problem.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« Reply #26 on: January 02, 2008, 04:01:34 PM »
Ok, i just confirmed that it is somehow related to the PID of the processes. I launched 3 test programs sequentially and they were closed by the same order i started them.

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 #27 on: January 02, 2008, 05:15:53 PM »
PIDs aren't necessarily delegated sequentially...
- carpe noctem

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,296
    • View Profile
    • www.StoicJoker.com
    • Donate to Member
Re: IDEA: kill specified programs "harshly/silently" at shutdown
« Reply #28 on: January 02, 2008, 07:09:29 PM »
Ok, I realize the point of the exercise is to code a small utility that does something, But... for a wifi tray tool I can't help but think there's a reason it's having trouble unloading. I've resolved issues like this using BootVis (a free MS utility) several times in the past.

(My "day job" is network administrator/engineer for a local IT company.)

Sorry just had to ask, carry on...

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: kill specified programs "harshly/silently" at shutdown
« Reply #29 on: January 02, 2008, 07:12:19 PM »
Hm, bootvis? I thought it only traced bootup, not shutdown?
- carpe noctem

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,296
    • View Profile
    • www.StoicJoker.com
    • Donate to Member
Re: IDEA: kill specified programs "harshly/silently" at shutdown
« Reply #30 on: January 02, 2008, 08:00:01 PM »
Hm, bootvis? I thought it only traced bootup, not shutdown?
Its primary focus is the startup, true. But smoother shutdown are a common side effect of its adjustments.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: kill specified programs "harshly/silently" at shutdown
« Reply #31 on: January 02, 2008, 08:06:01 PM »
PIDs aren't necessarily delegated sequentially...
You're absolutelly right. And in my experiment, they probably were not sequential. I wonder where could we get more data on how this works. Probably it just isn't that "certain".

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,434
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: kill specified programs "harshly/silently" at shutdown
« Reply #32 on: January 03, 2008, 02:05:26 PM »
www.ghacks.net just posted something related which could be useful.
it's useful for configuring how long windows itself should wait before terminating unresponsive processes at shutdown.

http://www.edev.no/i...ex.php?page=shutdown

shutdown.jpg

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: kill specified programs "harshly/silently" at shutdown
« Reply #33 on: January 03, 2008, 06:34:49 PM »
All it takes is modifying a couple of registry keys, but I guess that GUI thing is faster.

Just be careful you don't set it too low, or you could end up killing a program that is shutting down properly, but just taking a bit long to do it - possibly because it has to save that file you had open in it...
- carpe noctem

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 886
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: kill specified programs "harshly/silently" at shutdown
« Reply #34 on: February 09, 2008, 06:25:30 PM »
 :) I needed this tool, too, so if you haven't found a solution yet, here's CloseKill.

Kills programs on system shutdown.
Example: CloseKill.exe calc.exe,notepad.exe

Skrommel

;CloseKill.ahk
; Kills programs on system shutdown.`n
; Example: CloseKill.exe calc.exe,notepad.exe
;Skrommel @ 2008


#SingleInstance,Force
#Persistent

If 0=0
{
  MsgBox,0,CloseKill by www.1HourSoftware.com,
(
Kills programs on system shutdown`n
Example: CloseKill.exe calc.exe,notepad.exe
)
  ExitApp
}

Loop,%0%
{
  programs.=%A_Index%
  TrayTip,CloseKill,Waiting to kill`n%programs%
}

DllCall("kernel32.dll\SetProcessShutdownParameters", UInt, 0x4FF, UInt, 0)
OnMessage(0x11, "WM_QUERYENDSESSION")
Return


WM_QUERYENDSESSION(wParam, lParam)
{
  Global programs

  Loop,Parse,programs,`,
  {
    TrayTip,CloseKill,Killing %A_LoopField%
    Process,Close,%A_LoopField%
    Sleep,1000
  }
  ExitApp
}
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.

Cavalcader

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 194
  • Live Long & Prosper
    • View Profile
    • Donate to Member
Re: DONE: kill specified programs "harshly/silently" at shutdown
« Reply #35 on: May 05, 2008, 06:50:49 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.
Nudge, nudge   :)
My Linguistic Profile:
  40% General American English
  30% Yankee
  20% Dixie

What Kind of American English Do You Speak?
« Last Edit: May 05, 2008, 06:55:12 PM by Cavalcader »

Steven Avery

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 852
    • View Profile
    • Donate to Member
Karen's ShowStopper - reliable forced reboot
« Reply #36 on: May 08, 2008, 09:16:30 AM »
Hi Folks,

Just a quick note, without all the techie aspects.
When I wanted a real "forced reboot" program I found that a lot of them got snagged.

Karenware's freeware has been close to 100% reliable in truly forcing a shutdown.
(There are a number of other options as well.)

Showstopper
http://www.karenware...rtools/ptstopper.asp

http://www.karenware.../2003/2003-01-28.asp
Newsletter   
* Shutdown Types
* Show Stopper Extras
* Scheduled Shutdowns

I highly recommend this for the no-nonsense reboot.  I put a shortcut
easy to get to on my start menu, about the only program that I stick
there. (Other stuff else is in categories.)

Shalom,
Steven