Code:
Sub Main()

    Try
        'process i files on their own thread
        Dim iOperation As New Threading.ThreadStart(AddressOf ProcessI)
        Dim iThread As New Threading.Thread(iOperation)
        iThread.Start()

        'process d files on their own thread
        Dim dOperation As New Threading.ThreadStart(AddressOf ProcessD)
        Dim dThread As New Threading.Thread(dOperation)
        dThread.Start()

        'process p files on their own thread
        Dim pOperation As New Threading.ThreadStart(AddressOf ProcessP)
        Dim profThread As New Threading.Thread(pOperation)
        pThread.Start()

        'ensure all threads have finshished working
        'if you don't do this the program will terminate before the work is done
        iThread.Join()
        dThread.Join()
        pThread.Join()

    Catch ex As Exception
        'exceptions from worker threads will not bubble up, and will cause the application to hang
        Console.WriteLine(ex.ToString)
    End Try

End Sub
I'm running into a problem when I stop the debugger, the console window stays open, and I can't kill it via task manager. Any ideas?