a1jit Posted September 28, 2005 Posted September 28, 2005 Hi Guys, Is there any way to implement the logic below Check whether Test.exe is running or not. If its running, dont do anything. If it is not running, launch it Thank you very much Quote
Administrators PlausiblyDamp Posted September 28, 2005 Administrators Posted September 28, 2005 System.Diagnostics.Process[] procs = System.Diagnostics.Process.GetProcessesByName("Test"); if(procs.Length >= 1) System.Diagnostics.Process.Start("Test.exe"); should get you started Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
a1jit Posted September 28, 2005 Author Posted September 28, 2005 (edited) wOWOWO..Excellentttt...thax a lottttt... But im confused a little if procs.Length == 0 , then we should start up Test.exe .. Normally if the file is not running, meaning procs.Length will return 0 right? And im confused about another thing.. Whenever i put this code and create new project as a "Windows Service", No matter the executable is running or not, it always says that its running. Although it is not running..Pretty weird.. If its windows application, when i debug, it works well.. But when i create a service, it does not.. Any idea? Edited September 28, 2005 by a1jit Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.