using CloseMainWindow

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,
I'm trying to gracefully run all running processes for an application. The
problem I am running into in multiple people will be logged in for the app. I
am currently using:
For Each vProcessName In vProcessList.GetProcessesByName("processname")
Try
Dim vresult As Integer
vProcessName.CloseMainWindow()
Catch ex As Exception
End Try
Next

The problem I am having is this only ends the application for the logged in
session, not all sessions. Is there a security permission I can set to allow
the command to end all instances of the application?
Thanks,
Ron
 
Maybe, I said maybe, the problem is about "For Each"

Try to copy vProcessList.GetProcessesByName("processname") to an array of
string first, For Each with the array you created.
Because: You cannot let the array changed while For Each running.
 
Back
Top