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

Samsung Android Keyboard

  If you have a Samsung phone or pad and the keyboard is set to Google give the Samsung one a try. Just go into the keyboard settings and ...