SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Junior Member
    Join Date
    Aug 2006
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Closing all browsers with are opened with same URL

    Hi,

    I need a general script to meet the following requirements.

    1. No of browser objects were opened with SAME URL, say yahoo.com
    2. There might be some more browsers opened with different URLS
    3. Now the script has to close all browsers with Yahoo.com only.

    Thanks
    sudeer

  2. #2
    Senior Member
    Join Date
    Feb 2007
    Location
    Pittsburgh, USA
    Posts
    429
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Closing all browsers with are opened with same

    Try this:

    Set Obj = CreateObject("Shell.Application")
    Set winObj = Obj.windows
    For i= 0 to winObj.Count-1
    Set eachObj = winObj.Item(i)
    j=0
    If Mid(eachObj.LocationURL,1,20) ="http://www.yahoo.com" Then
    eachObj.Quit
    j = j + 1
    End If
    Next
    Msgbox "http://www.yahoo.com -> count = "& j
    Set eachObj = Nothing
    Set winObj = Nothing
    Set Obj = Nothing

    -Reddy
    -Reddy

  3. #3
    Senior Member
    Join Date
    Jan 2007
    Location
    Pune, India
    Posts
    466
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Closing all browsers with are opened with same

    Keep opened 3 browser of yahoo and check this script.

    It Fails!!

  4. #4
    Senior Member
    Join Date
    Feb 2006
    Location
    Bangalore
    Posts
    593
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Closing all browsers with are opened with same

    Instead of For i=0 To rather try this:

    For each eachobj in winObj.Count-1

    NameOFApp=eachObj.LocationURL
    IF NameOFApp="" Then
    eachobj.quit


    '***************
    Vengat Ramanan.R

  5. #5
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Closing all browsers with are opened with same

    This is beacuse when you use eachObj.Quit then it decrease the winobj.count also. So the loop will only delete the odd browser and all even browser will remain open.

    <font class="small">Code:</font><hr /><pre>
    i = 0
    While i &lt; winObj.Count
    Set eachObj = winObj.Item(i)

    If Mid(eachObj.LocationURL,1,20) ="http://www.yahoo.com" Then
    eachObj.Quit
    Else
    i = i + 1
    End If
    Wend
    </pre><hr />
    Next

  6. #6
    Senior Member
    Join Date
    Jan 2007
    Location
    Pune, India
    Posts
    466
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Closing all browsers with are opened with same

    1 browser remains open!!

  7. #7
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Closing all browsers with are opened with same

    <font class="small">Code:</font><hr /><pre>
    Set Obj = CreateObject("Shell.Application")
    Set winObj = Obj.windows

    i = 0
    While i &lt;winObj.Count
    Set eachObj = winObj.Item(i)

    If Mid(eachObj.LocationURL,1,20) ="http://www.yahoo.com" Then
    eachObj.Quit
    i = i - 1
    Else
    i = i + 1
    End If
    Wend
    </pre><hr />

  8. #8
    Senior Member
    Join Date
    Jan 2007
    Location
    Pune, India
    Posts
    466
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Closing all browsers with are opened with same

    Works fine now!!

  9. #9
    Junior Member
    Join Date
    May 2007
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Closing all browsers with are opened with same

    Hi guys,

    Above this methods can find the Exact Link.Is there any way to find out the Sub Links Like http://www.yahoo.com/mail/

    Thnx,
    Anjani

  10. #10
    Senior Member
    Join Date
    Feb 2006
    Location
    Bangalore
    Posts
    593
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Closing all browsers with are opened with same

    Another idea;

    SystemUtil.CloseProcessByWndTitle "Yahoo"
    Vengat Ramanan.R

 

 
Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 9.38%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:04 PM.

Copyright BetaSoft Inc.