Solved

Close web browser automatically after inactivity?

Posted on 2009-07-08
8
2,325 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
 
LVL 17

Author Comment

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

Thanks for the help.
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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
0
 
LVL 17

Author Closing Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
This is about my first experience with programming Arduino.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

910 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now