Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Script - IE and others

Reply
Thread Tools Display Modes

Script - IE and others

 
 
John
Guest
Posts: n/a

 
      04-02-2009
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.
 
Reply With Quote
 
 
 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      04-02-2009

"John" <> wrote in message
news:E828E848-23AC-4A21-8ED6-...
> 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.


A crude but effective method would be to use taskkill.exe to kill
iexplore.exe 60 seconds after you've launched it.


 
Reply With Quote
 
John
Guest
Posts: n/a

 
      04-02-2009
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?

"Pegasus [MVP]" wrote:

>
> "John" <> wrote in message
> news:E828E848-23AC-4A21-8ED6-...
> > 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.

>
> A crude but effective method would be to use taskkill.exe to kill
> iexplore.exe 60 seconds after you've launched it.
>
>
>

 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a

 
      04-02-2009
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. )


"John" <> wrote in message
news:5DE044A0-A3D8-4991-969F-...
> 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?
>
> "Pegasus [MVP]" wrote:
>
>>
>> "John" <> wrote in message
>> news:E828E848-23AC-4A21-8ED6-...
>> > 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.

>>
>> A crude but effective method would be to use taskkill.exe to kill
>> iexplore.exe 60 seconds after you've launched it.
>>
>>
>>



 
Reply With Quote
 
John
Guest
Posts: n/a

 
      04-02-2009
Thank you, I'll git it a try.

"Pegasus [MVP]" wrote:

> 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. )
>
>
> "John" <> wrote in message
> news:5DE044A0-A3D8-4991-969F-...
> > 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?
> >
> > "Pegasus [MVP]" wrote:
> >
> >>
> >> "John" <> wrote in message
> >> news:E828E848-23AC-4A21-8ED6-...
> >> > 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.
> >>
> >> A crude but effective method would be to use taskkill.exe to kill
> >> iexplore.exe 60 seconds after you've launched it.
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Mark D. MacLachlan
Guest
Posts: n/a

 
      07-01-2009

John wrote:

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


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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bulldog (Need help with script downloaded from script center) Bulldog Bill Scripting 0 01-15-2009 08:37 PM
VBS Script error in Logon Script with AD change Webspeedway Active Directory 1 11-07-2006 01:55 AM
[MSH] - Is it possible to combine functions into a script/library file that can later be included into another script? Rahul Agarwal Scripting 1 12-05-2005 11:30 PM
Re: How to I Kill - Reset Idle Terminal / Remote Session thru VB Script or Batch Script on Windows 2000/2003 Chris King Scripting 0 07-07-2004 03:35 PM
Script Help Needed! Installing via Script when user does not have Admin Rights!!! Greg H Scripting 0 08-14-2003 01:41 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59