Display executable files in directory VB.Net Exercise - Visual Basic Programming Course


Display executable files in directory


Create a program that shows the names (excluding the path) of all executable files (.com, .exe, .bat, .cmd) in the current folder.


Imports System
Imports System.IO
Class DisplayExecutableFiles
    Private Shared Sub Main()
        Dim files As String() = Directory.GetFiles(".")

        For Each file As String In files
            Dim extension As String = Path.GetExtension(file)

            Select Case extension
                Case ".exe", ".com", ".bat", ".cmd"
            End Select
    End Sub
End Class

Juan A. Ripoll - Systems Tutorials and Programming Courses © 2024 All rights reserved.  Legal Conditions.