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
Solved

Close web browser automatically after inactivity?

Posted on 2009-07-08
8
2,406 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
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 200 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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 300 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 300 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
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…

860 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