phillip.hess@fhwa.dot.gov
Member
- Joined
- Mar 13, 2007
- Messages
- 5
- Programming Experience
- Beginner
I have a situation where I'm running a silent install of an application called Interplot written by Bentley Corp. When the setup.exe /s is started it inturns starts another process. If I use the command
Dim myProcess_Install As Process = System.Diagnostics.Process.Start("C:\Temp\Interplot_08_05_02_63\Install\setup.exe", "/s") it only monitors the setup.exe until it passes off to the second process. The Process name is _INS5576._MP. I'm trying to find the second process that's already running and wait for it to exit. Here is my code:
Module Process_Running
Sub ActivatePrevInstance(ByVal argStrAppToFind AsString)
Dim MyProcess As Process
Dim objProcess AsNew Process()
Dim objProcesses() As Process
objProcesses = Process.GetProcesses()
ForEach objProcess In objProcesses
If (objProcess.ProcessName) = (argStrAppToFind) Then
MyProcess = Process.GetCurrentProcess
ExitFor
EndIf
Next
If MyProcess.Responding Then
MyProcess.WaitForExit()
EndIf
EndSub
EndModule
The variable argStrAppToFind is being passed _INS5576._MP. everything runs untill it gets to the line MyProcess.WaitForExit(). At that point it just hangs. When in debug mode and you are looking at the "Locals" it say that is can't find any information on the process. Any help would be greatly appreciated.
Thanks
-Phillip
Dim myProcess_Install As Process = System.Diagnostics.Process.Start("C:\Temp\Interplot_08_05_02_63\Install\setup.exe", "/s") it only monitors the setup.exe until it passes off to the second process. The Process name is _INS5576._MP. I'm trying to find the second process that's already running and wait for it to exit. Here is my code:
Module Process_Running
Sub ActivatePrevInstance(ByVal argStrAppToFind AsString)
Dim MyProcess As Process
Dim objProcess AsNew Process()
Dim objProcesses() As Process
objProcesses = Process.GetProcesses()
ForEach objProcess In objProcesses
If (objProcess.ProcessName) = (argStrAppToFind) Then
MyProcess = Process.GetCurrentProcess
ExitFor
EndIf
Next
If MyProcess.Responding Then
MyProcess.WaitForExit()
EndIf
EndSub
EndModule
The variable argStrAppToFind is being passed _INS5576._MP. everything runs untill it gets to the line MyProcess.WaitForExit(). At that point it just hangs. When in debug mode and you are looking at the "Locals" it say that is can't find any information on the process. Any help would be greatly appreciated.
Thanks
-Phillip