Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8074055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:31:51+00:00 2026-06-05T14:31:51+00:00

I have a progress indicator implemented as a small IE window which my script

  • 0

I have a progress indicator implemented as a small IE window which my script (VbScript) launches. Outside of embedding a script in the HTML file, I am hoping for a way to detect if the user exits this window, so that I can ‘clean up’.

Is there any built in way, using VBScript (again, really hoping for not embedding script in the html), of detecting whether the user has exited this IE window? Currently, I am attempting to check for the non-existence of iexplore.exe, however this is proving to be a huge task due to the nature of this progress dialog, and it comes with too many risks to be acceptable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:31:53+00:00Added an answer on June 5, 2026 at 2:31 pm

    If you use the CreateObject’s second parameter, you can write your script to respond to IE events. IE exposes the onQuit event that is fired when a window is closed. Make sure you specify the WScript variant of the CreateObject method. The native VBScript one does not support the required second parameter.

    Set objIE = WScript.CreateObject("InternetExplorer.Application", "IE_")
    
    ' Set up IE and navigate to page
       ' ...
    
    ' Keep the script busy so it doesn't end while waiting for the IE event
    ' It will start executing inside the subroutine below when the event fires
    Do While True
        WScript.Sleep 1000
    Loop
    
    ' Execute code when IE closes
    Sub IE_onQuit
        'Do something here
    End Sub
    

    You can learn more about this method with a more thorough example here. This is a good asynchronous solution.

    A second method uses WMI to launch IE so that you have a direct object to the running instance. When the instance is closed, the object reference becomes null.

    Const SW_NORMAL = 1
    strCommandLine = "%PROGRAMFILES%\Internet Explorer\iexplore.exe"
    
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    
    Set objProcessStartup = objWMIService.Get("Win32_ProcessStartup")
    Set objStartupInformation = objProcessStartup.SpawnInstance_
    objStartupInformation.ShowWindow = SW_NORMAL
    objStartupInformation.Title = strUniqueTitle
    
    Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
    intReturn = objProcess.Create("cmd /k" & vbQuote & strCommandLine & vbQuote, null, objStartupInformation, intProcessID)
    
    Set objEvents = objWMIService.ExecNotificationQuery( _
        "SELECT * FROM __InstanceDeletionEvent " & _
        "WHERE TargetInstance ISA 'Win32_Process' " & _
        "AND TargetInstance.PID = '" & intProcessID & "'")
    
    ' The script will wait here until the process terminates and then execute any code below.
    Set objReceivedEvent = objEvents.NextEvent
    
    ' Code below executes after IE closes
    

    This solution uses WMI to start a process instance and return its process ID. Then it uses WMI events to watch for the process to end. This in a synchronous method and script execution will stop and wait until the process completes. This could also be done asynchronously with the ExecNotificationQueryAsync method, but this type of scripting is much less common.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have progress.js file which has the following code $('#text_area_input').keyup(function() { var text_area_box =$(this).val();//Get
I'm creating a little Java application which should have a progress indicator with percentages.
I have a progress bar which inherits from JSlider to provide highlighting functionality. Highlights
I am making an application in which i have put a progress bar .
nunit-console doesn't give a progress indicator at the command line indicating tests that have
I have a nice progress indicator from Need a progress indicator for a Perl
I have a circular progress indicator. I'd like to add this progress bar to
I have a PHP script that loads a function which uses Curl to log
I have a progress indicator in one of my classes, that is subclass of
In my WPF app, I have particular Window which contains, amongst other controls, a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.