Chọn xóa các file theo dung lượng trong thư mục, link logo Tâm Anh

@echo off
setlocal
:: Size is in bytes
set "max.size=100000000"

for /f  "usebackq delims=;" %%A in (`dir /b /A:-D *.*`) do If %%~zA GTR %max.size% del "%%A"


Tạo file *.cmd cho vào thư mục cần xóa file

*.* mask cho các file cần xóa

 EQU : Equal
 NEQ : Not equal

 LSS : Less than <
 LEQ : Less than or Equal <=

 GTR : Greater than >
 GEQ : Greater than or equal >=

Tham khảo: https://stackoverflow.com/questions/39646194/deleting-files-smaller-than-a-certain-size-with-batch




No comments:

Post a Comment

MS 365 chạm giới hạn số lượng xóa user cùng lúc

Để tránh xóa nhầm, trên hệ thống AAD Connect sẽ có giới hạn số lượng user xóa trong cùng 1 lượt:  https://learn.microsoft.com/en-us/entra/id...