How to delete folder in VBS – simple way

Posted on 28 March 2010 by Marius Ignatescu

Note: This code requires that you add a reference to the Microsoft Scripting Runtime type library.
This example will delete “C:\Temp” directory and all its sub-directories.

Dim fso As New Scripting.FileSystemObject

fso.DeleteFolder “c:\temp”, True

That was all. :)


Add a comment