Jump to content

Recommended Posts

Posted

We created an exe from Visual Studio that just opens a browser to a designated web page (.aspx file).  The web page does some processing and then closes.  We added running it from windows task scheduler and it runs fine. However, it leaves processes in the Task Manager called "iexplore.exe *32" for some reason. If I just run the exe by double clicking it it does not leave the "iexplore.exe *32" processes in Task Manager.  It is freaky. Any ideas?


Posted

Added a separate task job in scheduler that runs command below.

 

TASKKILL /F /IM iexplore.exe

 

Seems to work so far.

Posted

Ideally, your usage of taskkill should be run from within the EXE itself, rather than potentially leaving something behind in Task Scheduler. Hopefully you won't run into a situation where this task runs when it shouldn't.

Posted

I would like to do it inside the exe but not sure how to do this.  The exe opens IE to a specific web page.  That web page runs some code to update accounting files from an SQL Server database.  The web page is still running when the exe windows form closes so iexplore.exe is still running.  The web page uses window.close in final code so that web page auto closes when updating is done.  Below is my exe code in case you have any suggestions.

Public Class Form1    Public Sub Main()        Try            Dim webAddress As String = "http://msnt01/BodyShop/Updater.aspx?from=vb"            Dim P As Process = Process.Start(webAddress)            P.WaitForInputIdle()            P.Kill()        Catch        Finally            Application.Exit()        End Try    End Sub    Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load        Main()    End SubEnd Class
Posted

I do not use your language, however the theory would be the same. So the website itself will close the browser window. Your program can wait for the window to close. And then once it is closed, it can then kill the iexplore.exe process before exiting.

  • 3 months later...
Posted

I don't have any studio's open in front of me, but sample the code below:

dim proc as ProcessStartInfo("cmd.exe")dim pr as Processpr=Process.Start(proc)pr.StandardInput.WriteLine("taskkill /f /im iexplorer.exe")

Add that between the try/catch. The application will still close afterwards too (at least it should).

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...