1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Checking and Ending processes.

Discussion in 'Software Development' started by iLee, Dec 21, 2011.

Thread Status:
Not open for further replies.
  1. iLee

    iLee Thread Starter

    Joined:
    Jan 21, 2009
    Messages:
    52
    Hi there, i'm dev'ing an application that checks if processes are open, I have this bit sorted to kill the process if it's open.

    However, I need another process to check if the remaining process is open. So it'll loop.

    Process1
    Process2

    If process 1 gets closed, it'll close process2, and vice versa.

    PHP:
    Try
                
    Dim npProc() As Process
                npProc 
    Process.GetProcesses
                
    For Each proc As Process In npProc
                    
    If proc.ProcessName.Equals("antikill2"Then
                    
    Else
                        
    Dim "npProc"() As Process
                        npProc 
    Process.GetProcesses
                        
    For Each "proc" As Process In npProc
                            
    If proc.ProcessName.Equals("Gunbound"Then
                                proc
    .Kill()
                            
    End If
                        
    Next
                    End 
    If
                
    Next
            
    Catch ex As Exception
            End 
    Try
    With the parts enclosed in "", these parts give me errors of 'Hides a variable in an enclosing block'

    Any help is appreciated.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1032279

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice