Edgar82 Posted December 3, 2015 Share Posted December 3, 2015 Hi everybody, Im searching for a script that can delete files and folders except the folder d:\Users\ and all the files and folders under this folder. It doesn't matter if it is VB or Bat file. How can we manage this? Link to comment Share on other sites More sharing options...
smus Posted March 10, 2016 Share Posted March 10, 2016 You can check the folders through the cycle. It's gonna look like this: @echo off set allfolders = 'dir /b /s /a:d D:' set usersfolder = 'D:\users\' for /f "delims=" %%I in %%allfolders do ( [here's the exception] ) [here is the deletion] Link to comment Share on other sites More sharing options...
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