Discussion:
Script - IE and others
(too old to reply)
John
2009-04-02 11:39:01 UTC
Permalink
Hello everyone,

Does anyone knows how to script IE or other existing browsers in a given
server?

Here's What I'm trying to:
I have a schedule tasks that runs every 2 min, in that batch there're some
things to do, and if one of those things fail, it writes the results to a log
and additionally I would like to open a URL that will trigger another action
in a remote server.

I already used the "start Iexplore.exe www.something.com/fgfgfgfgfjjjhk/..."
the problem is that once the IE is open it stays open, and every time that
the command "start Iexplore.exe www.something.com/fgfgfgfgfjjjhk/..." is
called from the batch file, it opens a new window!!!

Does anyone has a alternative solution to me needs? It doesn't have to be
the Iexplore.exe, I could use any other tool that allows me to call a URL and
after a given time that URL should be closed.


Thank you for your time.
Pegasus [MVP]
2009-04-02 11:50:27 UTC
Permalink
Post by John
Hello everyone,
Does anyone knows how to script IE or other existing browsers in a given
server?
I have a schedule tasks that runs every 2 min, in that batch there're some
things to do, and if one of those things fail, it writes the results to a log
and additionally I would like to open a URL that will trigger another action
in a remote server.
I already used the "start Iexplore.exe
www.something.com/fgfgfgfgfjjjhk/..."
the problem is that once the IE is open it stays open, and every time that
the command "start Iexplore.exe www.something.com/fgfgfgfgfjjjhk/..." is
called from the batch file, it opens a new window!!!
Does anyone has a alternative solution to me needs? It doesn't have to be
the Iexplore.exe, I could use any other tool that allows me to call a URL and
after a given time that URL should be closed.
Thank you for your time.
A crude but effective method would be to use taskkill.exe to kill
iexplore.exe 60 seconds after you've launched it.
John
2009-04-02 11:59:04 UTC
Permalink
Hi Pegasus

Thank you for the fast response, but how do I know what PID is associated to
that specific process?

Do you know other methods or tools to do this?
Post by Pegasus [MVP]
Post by John
Hello everyone,
Does anyone knows how to script IE or other existing browsers in a given
server?
I have a schedule tasks that runs every 2 min, in that batch there're some
things to do, and if one of those things fail, it writes the results to a log
and additionally I would like to open a URL that will trigger another action
in a remote server.
I already used the "start Iexplore.exe
www.something.com/fgfgfgfgfjjjhk/..."
the problem is that once the IE is open it stays open, and every time that
the command "start Iexplore.exe www.something.com/fgfgfgfgfjjjhk/..." is
called from the batch file, it opens a new window!!!
Does anyone has a alternative solution to me needs? It doesn't have to be
the Iexplore.exe, I could use any other tool that allows me to call a URL and
after a given time that URL should be closed.
Thank you for your time.
A crude but effective method would be to use taskkill.exe to kill
iexplore.exe 60 seconds after you've launched it.
Pegasus [MVP]
2009-04-02 12:51:52 UTC
Permalink
You need to look for the process that runs your web page, e.g. like so:
1. @echo off
2. start /b "Explorer" "C:\Program Files\Internet Explorer\iexplore.exe"
www.google.com
3. ping localhost -n 60 > nul
4. for /F "tokens=2" %%a in ('tasklist /v ^| find /i "google"') do set
PID=%%a
5. if not "%PID%"=="" (
6. echo Killing process %PID%
7. taskkill /pid %PID%
8. )
Post by John
Hi Pegasus
Thank you for the fast response, but how do I know what PID is associated to
that specific process?
Do you know other methods or tools to do this?
Post by Pegasus [MVP]
Post by John
Hello everyone,
Does anyone knows how to script IE or other existing browsers in a given
server?
I have a schedule tasks that runs every 2 min, in that batch there're some
things to do, and if one of those things fail, it writes the results to
a
log
and additionally I would like to open a URL that will trigger another action
in a remote server.
I already used the "start Iexplore.exe
www.something.com/fgfgfgfgfjjjhk/..."
the problem is that once the IE is open it stays open, and every time that
the command "start Iexplore.exe www.something.com/fgfgfgfgfjjjhk/..." is
called from the batch file, it opens a new window!!!
Does anyone has a alternative solution to me needs? It doesn't have to be
the Iexplore.exe, I could use any other tool that allows me to call a
URL
and
after a given time that URL should be closed.
Thank you for your time.
A crude but effective method would be to use taskkill.exe to kill
iexplore.exe 60 seconds after you've launched it.
John
2009-04-02 14:13:01 UTC
Permalink
Thank you, I'll git it a try.
Post by Pegasus [MVP]
2. start /b "Explorer" "C:\Program Files\Internet Explorer\iexplore.exe"
www.google.com
3. ping localhost -n 60 > nul
4. for /F "tokens=2" %%a in ('tasklist /v ^| find /i "google"') do set
PID=%%a
5. if not "%PID%"=="" (
6. echo Killing process %PID%
7. taskkill /pid %PID%
8. )
Post by John
Hi Pegasus
Thank you for the fast response, but how do I know what PID is associated to
that specific process?
Do you know other methods or tools to do this?
Post by Pegasus [MVP]
Post by John
Hello everyone,
Does anyone knows how to script IE or other existing browsers in a given
server?
I have a schedule tasks that runs every 2 min, in that batch there're some
things to do, and if one of those things fail, it writes the results to
a
log
and additionally I would like to open a URL that will trigger another action
in a remote server.
I already used the "start Iexplore.exe
www.something.com/fgfgfgfgfjjjhk/..."
the problem is that once the IE is open it stays open, and every time that
the command "start Iexplore.exe www.something.com/fgfgfgfgfjjjhk/..." is
called from the batch file, it opens a new window!!!
Does anyone has a alternative solution to me needs? It doesn't have to be
the Iexplore.exe, I could use any other tool that allows me to call a
URL
and
after a given time that URL should be closed.
Thank you for your time.
A crude but effective method would be to use taskkill.exe to kill
iexplore.exe 60 seconds after you've launched it.
Mark D. MacLachlan
2009-07-01 03:51:02 UTC
Permalink
Post by John
Hello everyone,
Does anyone knows how to script IE or other existing browsers in a
given server?
I have a schedule tasks that runs every 2 min, in that batch there're
some things to do, and if one of those things fail, it writes the
results to a log and additionally I would like to open a URL that
will trigger another action in a remote server.
I already used the "start Iexplore.exe
www.something.com/fgfgfgfgfjjjhk/..." the problem is that once the IE
is open it stays open, and every time that the command "start
Iexplore.exe www.something.com/fgfgfgfgfjjjhk/..." is called from the
batch file, it opens a new window!!!
Does anyone has a alternative solution to me needs? It doesn't have
to be the Iexplore.exe, I could use any other tool that allows me to
call a URL and after a given time that URL should be closed.
Thank you for your time.
You will want to use vbscript to open IE, you can then easily navigate
to the internal web page, wait however long you need and then close IE.
Here is the code you need.
[code]
'=======================================================================
===
'
' NAME:
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: http://www.thespidersparlor.com
' DATE : //2009
' COPYRIGHT © 2009, All Rights Reserved
'
' COMMENT:
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE
SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'
'=======================================================================
===
Dim objIE
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = False
objIE.Navigate "http://www.thespidersparlor.com"
objIE.Visible = True
'Wait 10 seconds (number in milliseconds)
WScript.Sleep 10000
'Now close IE
objIE.Quit
[/code]

--

Loading...