0

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.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by GeekByChoiCe
0

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()

Edited by GeekByChoiCe: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.