::应该。。。。。不会造成不良结果。适于ntfs格式的磁盘
@echo off
for %%a in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do (
if exist %%a: (
%%a: &cd\
for /f "tokens=*" %%b in ('dir /a-d /b autorun.inf') do (del /a /f /q %%b)
::如果这时候还存在autorun.inf 那应该就是删不掉的文件夹了
if exist autorun.inf goto :fail
md autorun.inf &cd autorun.inf
md a..\ &md con\ &md nul\ &md aux\ &md com1\
cd..
attrib autorun.inf +a +s +h +r
echo y|cacls autorun.inf /p everyone:n
))
:2
cls
echo 是否取消?
set /p in=(y/n)
if /i %in%==y goto delete
if /i %in%==n (exit) else (goto 2)
:delete
for %%c in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do (
if exist %%c:\autorun.inf (
%%c: &cd\
echo y|cacls autorun.inf /p everyone:f
cd autorun.inf
rd a..\ &rd con\ &rd nul\ &rd aux\ &rd com1\
cd..
rd autorun.inf /s /q
))
exit