How to check if Notepad is running on the local windows computer in VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()

        Dim processByName As Process() = Process.GetProcessesByName("notepad")

        If processByName Is Nothing Or processByName.Length = 0 Then
            Console.WriteLine("Notepad is not running")
        Else
            Console.WriteLine("Notepad is running")
        End If

    End Sub

End Module

' run:
' 
' Notepad is not running

 



answered Aug 11, 2018 by avibootz

Related questions

1 answer 229 views
1 answer 287 views
1 answer 204 views
1 answer 186 views
186 views asked Oct 5, 2018 by avibootz
...