0

I would like to go to a certain link every 10 minutes. I did a batch file to run an IE instance with path specified:

start /d iexplore.exe http://dbmsportal/generateXML.php

Task completes well, but the problem is Task Scheduler creates a new instances of iexplore each time.

I am new in a CMD commands could someone suggest me how to regularly proceed bat file within one instance. Maybe I have to kill the process each time?

halfer
  • 19,824
  • 17
  • 99
  • 186
user2992532
  • 27
  • 1
  • 8
  • Wouldn't it make more sense to have something in JavaScript that simply refreshes the page every 10 minutes? – SomethingDark Oct 04 '16 at 05:15
  • @SomethingDark I don't have an access to the target link webpage's source. Also it might not be opened all time. Thanks for the idea anyway. – user2992532 Oct 04 '16 at 05:49
  • You can try with the batch file in [this answer](http://stackoverflow.com/a/39590203/2861476). – MC ND Oct 04 '16 at 06:12

3 Answers3

0

This is a VBS script. Alter it to suit.

The LocationName is the title bar text (which is hidden in current versions of windows. I've thrown a msgbox in to display it. Delete the line when you find it.

Set objShell = CreateObject("Shell.Application")
Do 
    Set AllWindows = objShell.Windows
    For Each window in AllWindows
        msgbox window.locationname
        If window.locationname = "website1.com" then
            window.refresh2 3
        End If
    Next
    Wscript.sleep 5000
Loop
  • Don't put this in task scheduler. Some TS settings will prevent access. Press Winkey + R and type `shell:startup` and put this there. It always runs. As set it's 5 secs (or 5000 ms). –  Oct 04 '16 at 05:39
  • Your code works well, but I have to open the browser and keep the link opened, which is not acceptable in my case. Any ideas of how to do it as a background process? – user2992532 Oct 04 '16 at 06:05
  • Actually I don't need the browser content, it just a command to generate some XML, I would like to close this link after like couple of minutes. – user2992532 Oct 04 '16 at 06:07
  • Schedule it in TS then. I thought you wanted to look at it. –  Oct 04 '16 at 06:21
  • Thanks Noodles. Ive come up with scheduling another process that kills all iexplore processes each hour. – user2992532 Oct 04 '16 at 06:55
0

Ive come up with scheduling another process that kills All iexplore processes each hour:

taskkill /F /IM iexplore.exe

I know this is not a good solution, but I don't have time to learn VBS.

user2992532
  • 27
  • 1
  • 8
0

Make it a hidden window and add this on a new line before the code you currently have:

:openLink
timeout /T 600 >nul

and after the line of code you currently have add this:

goto :openLink
J03L
  • 314
  • 3
  • 17