I want this script to list all folders that contains "deleted" in the folder name but not if they is in a folder called "done".
For exampel: list the folder if it's in C:\temp
and if it's in C:\temp\random_folder_name
but not not if it's in C:\temp\done
dir /s "C:\temp" | findstr "\deleted"
short story, exclude all folders named "done" and their content.
You are almost there.
Findstr /v returns all lines, that do not contain the string
dir /ad will only show directories (Atrribut=Directory)
dir /s /ad "C:\temp" | findstr "\deleted" | findstr /v "\done"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With