For this purpose we have used recursive procedure.
VB.Net sample code
Imports System.IO
Public Class Form1
Dim strrootpath As String