How to get attributes of a file using batch file

前端 未结 3 1578
[愿得一人]
[愿得一人] 2020-12-17 04:34

I am trying to make a batch file to delete malicious files from pendrive. I know that these malicious files uses hidden,read only and system attributes mainly to hide itself

3条回答
  •  别那么骄傲
    2020-12-17 05:23

    This is dangerous code - but it'll delete read only, hidden and system files. It should fail to run on c: drive but I haven't tested it. Note that some Windows installs are on drives other than c:

    @echo off
    echo "%cd%"|find /i "c:\" >nul || (
    del *.??? /ar /s /f
    del *.??? /ah /s
    del *.??? /as /s
    )
    

提交回复
热议问题