I have a code that checks if the application is running, if it is not, the code starts application, if it is and it passes ... But it does so only that I execute it for the 1st time. I wish he checked every 5 seconds .. * in vb.net
code:
Sub Main()
Dim activo As Boolean
Dim myprocesses As Process()
myprocesses = Process.GetProcessesByName("check")
If myprocesses.Length > 0 Then
activo = True
Else
activo = False
Dim p As New ProcessStartInfo("check.exe")
p.WindowStyle = ProcessWindowStyle.Hidden
p.CreateNoWindow = True
Process.Start(p)
End If
System.Console.ReadKey()
End Sub