Luis Diaz
asked on
CMD: fast way to remove files based on extension (exclude & include extensions)
Hello,
I am looking for a fast way to
1-Delete files with specific extensions .log, .txt .pdf
2-Delete files and exclude files with specific extensions such as .log, txt
Thank you very much for your help.
I am looking for a fast way to
1-Delete files with specific extensions .log, .txt .pdf
2-Delete files and exclude files with specific extensions such as .log, txt
Thank you very much for your help.
EXPERT CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you oBda, could you please help me to adapt the command by calling powershell.exe through cmd?
EXPERT CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much! It works! Can someone provide cmd & windows batch approach?
Thank you very much! It works! Can someone provide cmd & windows batch approach?Do you want to recursively drill into subfolders, or just the top level folder?
»bp
ASKER
Both if possible.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much for those helpful proposals!
If this is for a file server then you may want to install the role File Server Resource Manager (File and Storage Services server role / File and iSCSI services / File Server Resource Manager) and define a "File Screen". The File Screen policy will allow you to excludes files.