topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Saturday December 14, 2024, 2:38 pm
  • Proudly celebrating 15+ 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

Author Topic: IDEA: warn if IE has been running for too long  (Read 6829 times)

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
IDEA: warn if IE has been running for too long
« on: July 05, 2006, 04:16 AM »
Hi,

I need a script that checks every 5 minutes if iexplore.exe is running - if iexplore.exe has been running non-stop for the last 48 hours, it should pop up a warning.

The script (which I want to add to my main AHK script) doesn't need to be extremely fancy, it's just that I can't come up with a good idea of how to approach this problem...

Reason why: if I let IE (typically several instances) run for several days, a "msiexec.exe" process will sooner or later show up. I'm not totally sure if it's my A/V trying to install something there or whatever, but if I don't close all IE instances, the existance of the "msiexec.exe" process will result in high(er) CPU loads, which result in more noise, more energy consumption and more heat.

I failed in monitoring the "msiexec.exe" process directly (no problem with other processes), Microsoft somehow keeps that info hidden from AHK.


jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: warn if IE has been running for too long
« Reply #1 on: July 05, 2006, 04:43 AM »
Ok, this should do it:
Code inside
IEtime := 0
settimer, checkIE, 300000 ;5 minutes
return

checkIE:
Process, Exist, iexplore.exe
If Errorlevel<> 0
  IEtime +=1
else
  IEtime := 0
If IEtime > 576   ;48 hours in groups of 5 minutes
  msgbox, Internet Explorer has been running for more than 48 hours!


Notice that if you open and close ieplorer in the space of 5 minutes, the script might think you haven't closed it at all, and you might fool it.

Other than that, i think it should work! :D

kimmchii

  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 360
    • View Profile
    • Donate to Member
If you find a good solution and become attached to it, the solution may become your next problem.
~Robert Anthony
« Last Edit: July 05, 2006, 04:55 AM by kimmchii »

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,069
    • View Profile
    • Donate to Member
Re: IDEA: warn if IE has been running for too long
« Reply #3 on: July 05, 2006, 06:20 AM »
Fascinating idea that anyone would want to keep IExplorer active on the desktop for 48 hours. Why?

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,964
    • View Profile
    • Donate to Member
Re: IDEA: warn if IE has been running for too long
« Reply #4 on: July 06, 2006, 08:20 AM »
I use Avant (which uses Explorer) to look at saved .mht files.
I close it afterwards.

A couple times I've noticed this:
Some time later (hours, days?) when closing down computer a window has popped up, saying its closing Avant.

Just an idle observation which I havent really tested - dont know if thats ie that keeps running secretly or Avant.
Last time after closing Avant, I checked in Proccess Explorer but couldnt see it.
Havent closed down though since. :huh: !!

 as I say, "Just an idle observation" - if I notice it again I could always use your script :)
Tom

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
Re: IDEA: warn if IE has been running for too long
« Reply #5 on: July 08, 2006, 03:27 AM »
Ok, this should do it:

[...]
Thanks jgpaiva, I will try it! :up:


i found this:
Another way to stop processes after a time limit
Limiting the time processes can run
Both things won't do what I need - I just need a warning, I have to check what is going to be closed first ;)


Fascinating idea that anyone would want to keep IExplorer active on the desktop for 48 hours. Why?
-Carol Haynes (July 05, 2006, 06:20 AM)
Easy: I use them as reminders... some book I consider buying, some (long) article I plan on reading, etc. Sometimes other tasks or life in general also interferes, so I just let it rest on my desktop for a while :)

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: warn if IE has been running for too long
« Reply #6 on: July 11, 2006, 03:56 PM »
 :tellme: I think detecting ahk_class IEFrame is more universal than detecting IExplore.exe. Many programs use the Internet Explorer engine without showing IExplore.exe in the tasklist.

Skrommel