找回密码
 加入
搜索
查看: 1967|回复: 2

删除多个文件问题和分区判断

[复制链接]
发表于 2008-6-4 14:38:12 | 显示全部楼层 |阅读模式
需要判断出第一个硬盘分区有几个,接着是判断分区里面有没有autorun.inf这个文件,有的话就删除分区里面的多个文件,目前是用批处理实现,希望有autoit的解决方案,批处理程序:
if exist d:\autorun.inf for /f "tokens=2 delims==" %%a in ('findstr /i "OPEN=" d:\autorun.inf') do set virus=%%a >nul 2>nul
if exist d:\autorun.inf cd /d d:\ >nul 2>nul
if exist d:\autorun.inf del /f/q/a %virus% pagefile.exe pagefile.com KILL.exe *logo*.exe *sy.exe>nul 2>nul

[ 本帖最后由 ronin 于 2008-6-4 16:58 编辑 ]
发表于 2008-6-4 16:38:14 | 显示全部楼层
不知道你是不是要这个效果.
[au3]$Drive=DriveGetDrive ("FIXED")
If @error=1 Then Exit
For $x=1 To $Drive[0]
        If FileExists($Drive[$x] & "\autorun.inf")=1 Then FileDelete($Drive[$x] & "\autorun.inf")
Next
Exit[/au3]
 楼主| 发表于 2008-6-4 16:58:36 | 显示全部楼层
差不多是这样
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-17 15:56 , Processed in 0.074389 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表