I have created a vb application that uses "shell" to run another vb application that uses a webbrowser to navigate to a web site and then sign in to the site and collect information for use in the original application.
I built the browser application to execute the navigation automatically when it is run.
I don't know how to terminate the second application after it has run, and the webbrouser window is left open. After several iterations I have several open windows open and would like to close them automatically, preferably from the calling application.

Any help would be appreciated.

if you use the Shell command it returns the process ID

Dim pid As Integer = Shell("C:\Windows\notepad.exe")
MsgBox(pid)

then you can simply kill the process ...

Process.GetProcessById(pid).CloseMainWindow()

if your second App is hidden then you can use

Process.GetProcessById(pid).Kill()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.