VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Recursive Deltree Sub

Andy Ault  (1 Submission)   Files/File Controls/Input/Output   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

Deletes a specified directory tree.

Inputs
sFolder: Folder tree to remove (ie "T:\TEMP")

Assumes
Note that "Dir" doesn't work as you may expect with recursive programs. This code works around that problem by re-doing the Dir w/parameters after calling itself recursively.

Returns
No return. If you need to use this in situations where filesor folders might have read-only attributes or can't be deleted for other reasons, you will need to modify the code to add error handling and return an error code.

Side Effects
As always with this type of code, use it carefully. You could wipe valuable data.

Rate Recursive Deltree Sub (7(7 Vote))
Recursive Deltree Sub.bas

Recursive Deltree Sub Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters