以下是我的一个例子,用上了访问权限--cacls命令 可以防住一部分autorun类的病毒,但没想到Avkiller用的是重命名,它能越过访问权限给我的autorun.inf重命名了,我没话说……大概是用注册表改的名吧……
::应该。。。。。不会造成不良结果。适于ntfs格式的磁盘
@echo off
set /p n=在这里输入建立不可删文件个数,不判断。最好是1^<n^<50___:
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
for /l %%d in (1,1,%n%) do (md %%d%%d &md %%d%%d\con\)
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
set /p m=在这里输入数字,不判断。最好是1^<n^<50___:
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
for /l %%e in (1,1,%m%) do (rd %%e%%e\con\)
cd..
rd autorun.inf /s /q
))
exit