I want to know if it\'s possible to rewrite this piece of code:
Private Sub PrepareDir(ByVal dir As String)
Dim fso As New FileSystemObject
If fso.Fo
The OP said they want to rewrite their code "without FSO" but it doesn't make sense.
If the goal is to reduce the amount of code, simply make it a one-liner:
CreateObject("Scripting.FileSystemObject").DeleteFolder "x:\myFolder"
As requested, this permanently removes the folder and it's contents.