This script works perfectly, however it deletes too much, How do it get it to exclude a directory when deleting?
FOR /R %%a IN (Setup File.msi) DO DEL "%%~dpaSetup File.msi"
The "Setup File.msi" could be in the root of where I'm running the batch file from as well as sub folders can be any name and any number of levels deep, hence the need for /R . I did find other possibilities to help answer this however they were deleting a file in 1 directory down and that's it, not what I need.
I'm basically trying to centralise messy install sets, I have Copied/Moved the latest files that I need to one folder but would like to delete any other traces of them else where apart from where I have copied them to. I don't want to just delete any file
though which is why I need to name a file to delete, but exclude the "Master" directory
p.s. I have only been learning this for 2 weeks so please explain clearly how your script works so I can learn
- Edited by Adam Lacey Tuesday, August 05, 2014 12:04 PM Just so more gramer