Page 1 of 1

Restarter

Posted: Sun May 09, 2010 4:15 pm
by NeedHelp
How can i make a application restarter, like this:

You select a program [c:/] And when that application is closed the program opens it and when its open it does nothing...

Re: Restarter

Posted: Sun May 09, 2010 5:42 pm
by mandai
Code: Select all
While True
        Dim myList As Process() = Process.GetProcessesByName("something.exe")
        If myList.Count < 1 Then
            Process.Start("something.exe")
        End If
        Threading.Thread.Sleep(100)
End While

Re: Restarter

Posted: Sun May 09, 2010 8:39 pm
by NeedHelp
That code crashed my pc -.-

It opens 100000 of a program !!

Re: Restarter

Posted: Sun May 09, 2010 8:58 pm
by NoWayIn
Well Im not sure what you're asking...
but to restart your application you would just do
Application Restart wrote:
Application.Restart()

Re: Restarter

Posted: Sun May 09, 2010 9:23 pm
by mandai
It will only start more than 1 of the program if your program is hiding itself from the processes list.

Re: Restarter

Posted: Mon May 10, 2010 12:55 pm
by NeedHelp
I want a program that starts another program and when you check [checkbox1]Restart if Crashes then it opens the program when its off...

http://www.mediafire.com/?mzhzjmjqewm