COV-Webmaster
asked on
VB Script or Batch File to Delete Files and Folder Except for Two Specified Folders That Should not be Deleted
I'm looking for a VB script or batch file that can delete all files and folders in a nested directory structure except for two specific folders. An example is:
C:\test\nextlevel\nextleve l\
Delete all files and folders except for:
C::\test\nextlevel\nextlev el\dontdel ete1
C::\test\nextlevel\nextlev el\dontdel ete2
I would appreciate any advice on how to do this.
Thanks.
C:\test\nextlevel\nextleve
Delete all files and folders except for:
C::\test\nextlevel\nextlev
C::\test\nextlevel\nextlev
I would appreciate any advice on how to do this.
Thanks.
ASKER
I would like to specify the full path to the folders that should not be deleted.
Thanks.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much! This works exactly the way I need it to.
Great, glad that helped.
~bp
~bp
C:\test\nextlevel\nextleve
C:\test\nextlevel\nextleve
or just
dontdelete1
dontdelete2
~bp