Thursday, 27 February 2014

Check If Process Running Then Run

 If you need to start a Process but need only a single instance of it to run you can check if
 the process is running then decide where to run yours or not  
 

If proc.ProcessName.StartsWith("aprogram.exe") = False Then   
 Try   
   proc.StartInfo.WorkingDirectory = "C:\Program Files\program \aprogram"       roc.StartInfo.FileName = "C:\Program Files\program\aprogram\aprogram.exe "      proc.StartInfo.Arguments = filename & ".CSV"      proc.Start() 
    Catch ex As Exception 
    msgbox(ex.message)  
 End Try 
 End If
 
 If you are using visual studio and your application is not a console application then 
you could set it as a single  instance application.

No comments:

Post a Comment

Chrome 138 the last supported

Chrome 138 the last supported  Hey Everyone, Chrome 138 is the last version of Chrome that will support Android 8.0 (Oreo) and Android 9.0 (...