In my code, I check if the executable file op.exe is in the application run path directory, in case if not, it does show MsgBox and exits the application, the problem is that it doesn't really exit the application, because the code after is executing everytime.

Here is the code I'm talking about:

    If Not File.Exists("op.exe") Then
        MsgBox("op.exe not found!", MsgBoxStyle.Critical, "Error")
        Application.Exit()
    End If
    IO.Directory.CreateDirectory('files')

MsgBox appears, and application does exit, but it's creating the directory files afterwards (IO.Directory.CreateDirectory('files')) . I dont want that, and I would like to completely close the application after showing the MsgBox.

How can I do that?

Edit
Report