Results 1 to 4 of 4
  1. #1

    Closing all existing browsers

    Hi All,

    I am having both IE and Moziall on my lab machine ... i want to write a script which closes all open browsers ... i got a code which closes only IE browser but not mozilla can u please send me a code which closes all browser (IE, Mozilla or netscape)


  2. #2

    Re: Closing all existing browsers

    What is your code? Search the forum there are codes that can do the thing that you desire

  3. #3

    Re: Closing all existing browsers

    Code is :

    'CreationTime" is a QTP browser property, which indicates the order in which browsers were opened.
    'The first browser that opens receives the value "CreationTime" = 0, the second browser receives "CreationTime" = 1, and so on...

    While Browser("CreationTime:=0").Exist

    ''Close all internet explorer windows
    'closedCount = SystemUtil.CloseProcessByName("iexplore.exe")
    ''Display # of closed windows
    'MsgBox closedCount

  4. #4

    Re: Closing all existing browsers

    Dim objProcess
    The following code will kill the process from the task manager.So all your open browsers will get killed.

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'firefox.exe' or Name = 'iexplore.exe'")

    For Each objProcess In colProcessList



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:15 PM.

Copyright BetaSoft Inc.