Delete a Directory or a Folder - Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

To delete a directory use the following code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

My.Computer.FileSystem.DeleteDirectory ("C:\Path\Folder", FileIO.DeleteDirectoryOption.DeleteAllContents)

End Sub

Share This

Home | About | Contact | Privacy Policy

Copyright 2018 - All Rights Reserved.