larrydavid
Programmer
Hello, I have a windows service that runs in a System.Thread which starts a timed event each day at a certain time, which works fine. Within this event I have processes I am trying to make dependent. Here is a snippet fron the OnTimedEvent method:
Private Sub OnTimedEvent(ByVal state As Object)
' Stop the existing timer...
oTimer.Dispose()
Try
testProcess1 = Process.Start("C:\Test\1\mspaint.exe")
If testProcess1.HasExited Then
testProcess1.Close()
testProcess2 = Process.Start("C:\Test\2\notepad.exe")
End If
Catch e As Exception
'Console.WriteLine("The following exception was raised: ")
'Console.WriteLine(e.Message)
myLog.WriteEntry((e.Message), EventLogEntryType.Information)
End Try
End Sub
The first process (MSPaint.exe) launches fine when the service starts, but when I go into TaskManager and End Process, the next process (notepad.exe) doesn't start.
If someone could please show me what I am overlooking I would greatly appreciate it.
Thanks,
Larry
Private Sub OnTimedEvent(ByVal state As Object)
' Stop the existing timer...
oTimer.Dispose()
Try
testProcess1 = Process.Start("C:\Test\1\mspaint.exe")
If testProcess1.HasExited Then
testProcess1.Close()
testProcess2 = Process.Start("C:\Test\2\notepad.exe")
End If
Catch e As Exception
'Console.WriteLine("The following exception was raised: ")
'Console.WriteLine(e.Message)
myLog.WriteEntry((e.Message), EventLogEntryType.Information)
End Try
End Sub
The first process (MSPaint.exe) launches fine when the service starts, but when I go into TaskManager and End Process, the next process (notepad.exe) doesn't start.
If someone could please show me what I am overlooking I would greatly appreciate it.
Thanks,
Larry