?
Solved

Close web browser automatically after inactivity?

Posted on 2009-07-08
8
Medium Priority
?
2,669 Views
Last Modified: 2015-01-05
On my Vista computer, i need it to close all web browser windows (IE, Firefox, Safari, Chrome) after 15 minutes of inactivity. This is because we are using a web login system which doesn't logout automatically and will remain logged in even after the computer sleeps. Maybe a script that runs before automatic sleep or hybernate. Other ideas?
0
Comment
Question by:Thomas4019
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 6

Expert Comment

by:jwenting
ID: 24810861
Even if you were to close those windows that wouldn't log you out from the web applications.
0
 
LVL 17

Author Comment

by:Thomas4019
ID: 24810893
This is a web login application, hosted internally from my router, and it logs out after closing the window.
0
 
LVL 8

Accepted Solution

by:
Nivlesh earned 800 total points
ID: 24811491
This app might be of help.

http://www.bdvnotepad.com/sysscr_en.htm

and you could write a script (download pstools from www.sysinternals.com .. and use the following to create the script

pskill iexplore.exe
pskill firefox.exe
pskill chrome.exe


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Author Comment

by:Thomas4019
ID: 24816004
That looks quite promising, i will try it now.

Thanks for the help.
0
 
LVL 10

Assisted Solution

by:TCB1
TCB1 earned 1200 total points
ID: 24839314
Also Autoit will do this and much more.

www.autoitscript.com
0
 
LVL 17

Author Comment

by:Thomas4019
ID: 24842034
Could you post a sample autoit script that would run an "exe" or "bat" or shortcut after a specified number of minutes of inactivity.

Now i am having problems with the screensaver way, in that certain programs seem to be preventing the screen saver from launching.
0
 
LVL 10

Assisted Solution

by:TCB1
TCB1 earned 1200 total points
ID: 24842803
Here is the script. Download autoit. You have the option to run the script as a .au3 file or you can convert it to an .exe. Change the inactivity time to your liking. I'm attaching the .au3 file. Just take off the .txt at the end.

while 1 ;run the script continuously in the background
      $startmousepos=mousegetpos() ;get the initial mouse position
      $start=TimerInit() ;Start the timer
      $end=timerdiff($start) ;Check the timer
      while $end<10000 ;Loop until timer is greater than 10 seconds (inactive threshold)
            sleep(1000) ;wait 1 second
            $endmousepos=mousegetpos() ;get the mouse position to see if changed
            if $startmousepos[0]<>$endmousepos[0] or $startmousepos[1]<>$endmousepos[1] Then
                  $startmousepos=$endmousepos ;if mouse postion changed, reset mouse position
                  $start=TimerInit() ;if mouse postion changed, reset timer
            EndIf
            $end=timerdiff($start) ;Check timer
      WEnd
      ;Do the following when the inactive threshold is met
      processclose("firefox.com") ;close firefox
      processclose("iexplorer.exe") ;close internet explorer
      processclose("chrome.exe") ;close Google Chrome
      processclose("safari.exe") ;close Safari
      ;May need to confirm the proper process name for each program you want to close.
        ;You can also close the programs via a winclose("Window Name") command. Check autoit docs   for more info.
WEnd
closewebpages.au3.txt
1
 
LVL 17

Author Closing Comment

by:Thomas4019
ID: 31628067
Thanks for your creative solutions.
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question