找回密码
 加入
搜索
查看: 3529|回复: 10

au3 怎么写删除D盘下所有的EXE文件呢?

[复制链接]
发表于 2008-5-29 15:18:59 | 显示全部楼层 |阅读模式
au3 怎么写删除D盘下所有的EXE文件呢?

[ 本帖最后由 aa147147 于 2008-7-12 15:55 编辑 ]
发表于 2008-5-29 15:45:03 | 显示全部楼层
del /s *.exe   MSDOS
 楼主| 发表于 2008-5-29 16:28:37 | 显示全部楼层
这个知道,我想用au3,不知道怎么写
 楼主| 发表于 2008-5-29 16:28:48 | 显示全部楼层
批处理,机子会卡
发表于 2008-5-29 17:10:08 | 显示全部楼层
用遞迴遍歷
再用FileDelete(path&"\*.exe")
发表于 2008-5-30 00:16:17 | 显示全部楼层
RunWait(@ComSpec & " /c " & 'del /s /y *.exe   ', "", @SW_HIDE)
发表于 2008-5-30 01:39:32 | 显示全部楼层
_filelist("D:\网络游戏")
Func _filelist($searchdir) 
        $search = FileFindFirstFile($searchdir & "\*.*")
        If $search = -1 Then Return -1
        While 1
                $file = FileFindNextFile($search)
                If @error Then
                        FileClose($search)
                        Return
                ElseIf $file = "."  Or $file = ".."  Then
                        ContinueLoop
                ElseIf StringInStr(FileGetAttrib($searchdir & "\" & $file), "D") Then
                        _filelist($searchdir & "\" & $file)
                EndIf
                If StringRight($file, 4) = ".exe"  Then
                        Sleep(5)
                        FileSetAttrib($searchdir & "\" & $file,"-RASH")
                        FileDelete($searchdir & "\" & $file)
                EndIf
        WEnd
EndFunc   ;==>_filelist
发表于 2008-5-31 03:44:09 | 显示全部楼层
跟6楼的一样
_rundos(del /s /f d:\ *.exe)
发表于 2008-6-1 15:04:04 | 显示全部楼层
发个以前清理熊猫留下的垃圾用的BAT     嘿嘿
@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%i in ('fsutil fsinfo drives^|find /v ""') do (
    set var=%%i
    set drive=!var:~-2!
    fsutil fsinfo drivetype !drive!|find "固定">nul && del /a /f /s !drive!\_desktop.ini
)
pause
发表于 2008-6-1 17:06:41 | 显示全部楼层
7楼的是真正AU3的解法,其它几楼的,都是通过DOS来实现,严格来说与AU3没有联系了
但从速度上来说,反而是7楼的为慢,AU3的递归遍历,速度确实不及DOS
怎么选择,就看个人喜好及实际需要了
发表于 2008-6-1 23:57:24 | 显示全部楼层
7楼的看不懂能不能来讲讲?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-20 08:26 , Processed in 0.072009 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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