简体   繁体   中英

Delete recursively some file without certain extensions

I've some big folders with many subfolders and i need to delete all files that aren't image jpeg|tiff|bmp|png|eps|gif and keep only that files with these extensions.

I ask something with windows powershell or prompt

try this

@echo off
set ROOTDIR=E:\Testdel\
for /f "delims=" %%F in ('dir %ROOTDIR% /s /b /a-d ^|findstr /vile ".jpeg .jpg .gif .png .tiff .bmp .eps .cdr .cpt .psd"') do del "%%F"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM