Search code examples
internet-explorercroncygwin

Cygwin crontab navigate to phpwebpage


I'm trying execute the following in crontab: I want to open internet explorer (because it's the only browser installed on the system) and let it navigate to a webpage so a phpscript is executed. After a few minutes I want to execute a script that closes the internet explorer process. (Because I don't want it to hog up memory as more browsers will be opened during the day).

Is this possible in cygwin?


Solution

  • Yes it is possible! :-)

    In crontab, set this (adjust the times according to how much it should run):

    * * * * * '/cygdrive/c/Program Files (x86)/Internet Explorer/iexplore.exe' https://somesite.com/test/test.php
    

    Create a batch script, put it somewhere, let's say in c:\scripts\killIE.bat with the following content:

    TASKKILL /F /FI "USERNAME eq [username]" /IM iexplore.exe
    exit
    

    (replace [username] with your username.

    Let it run every hour or w/e you want:

    0 * * * * '/cygdrive/c/scripts/killIE.bat'