Delete files less than a specific size

前端 未结 6 1038
情书的邮戳
情书的邮戳 2020-12-18 12:55

I would like to delete all files that are less than a specific size in a directory. Does anyone know if there is a Windows command that will do this? something like de

6条回答
  •  忘掉有多难
    2020-12-18 13:20

    Ok so I used AtomicParsley in a cmd script to add artwork to all my MP4 movies in over 400 sub folders with the --overWrite option. It sometimes barfs and the orignal file is left at less than 2k. I needed a way to find all these messed up MP4 files so I can redownload them.

    This is what I used from the command line using Mrchief's example and it works like a charm in windows 7.

    @for /f  "usebackq delims=;" %A in (`dir /s /b *.mp4`) do @If %~zA LSS 2048 echo "%A"
    

    and this is the output after processing 32 of the files

        D:\Movie>@for /f  "usebackq delims=;" %A in (`dir /s /b *.mp4`) do @If %~zA LSS 2048 echo "%A"
        "D:\Movie\Action\Deadland (2009)\Deadland (2009).mp4"
        "D:\Movie\Science Fiction\Alien3 (1992)\Alien3 (1992).mp4"
    
        D:\Movie> 
    

    you could replace the echo with del and change the 2048 to search for a different size.

提交回复
热议问题