ful56_uk Posted April 30, 2010 Posted April 30, 2010 hi guys does any one have any vb code that will the the folder contents of a folder on a local machine but leave the root folder in place mark
box_l Posted April 30, 2010 Posted April 30, 2010 (edited) deletes folders and files too Dim fso, fldr Set fso = CreateObject("Scripting.FilesystemObject") Set fldr = fso.GetFolder("c:\test_area") 'delete subfolders For Each subf In fldr.SubFolders subf.Delete True Next 'delete subfiles For Each fsofile In fldr.Files fsofile.Delete True Next edit: be careful where you run this, it deletes everthing below! Edited April 30, 2010 by box_l
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now