sunyelover 发表于 2008-5-19 16:03:39

如何用AU3删除系统垃圾

BAT形式是这样的
@echo off
echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系统LJ完成!
echo. & pause
用AU3可以实现么?????????????

kuautoit 发表于 2008-5-19 18:36:10

注意

要运行 DOS(控制台)命令,请使用 RunWait(@ComSpec & " /c " & '命令', "", @SW_HIDE)



你看看RUN帮助

asdf 发表于 2008-5-19 19:51:46

/s这个比较难实现,因为要遍历--但是遍历删除这些东西,是有害的。

fudec2008 发表于 2008-5-19 20:15:29

au3实现这实在是太容易了,其实au3就是windows下的批处理。

asdf 发表于 2008-5-19 20:40:26

楼上,/s是个遍历开关啊……au3只有通配符,没有遍历开关……

木纳 发表于 2008-5-19 22:13:51

四楼的意思大概是fileinstall(bat),然后run(bat)吧....

若LZ是想用au3来实现,正如 asdf兄所说,遍历这个没直接给出来

期待哪位大大能给出这个函数来.

马甲 发表于 2008-5-19 23:47:33

_filelist("F:\movie")

Func _filelist($searchdir)                        ;;;函数名(形参)
$search = FileFindFirstFile($searchdir & "\*.*")       ;;;;查找c:根目下的文件
If $search = -1 Then return -1                   ;;;;如果找不到,返回值 -1
While 1
    $file = FileFindNextFile($search)         ;;;查找下一个文件
    If @error Then                                        ;;;如果找不到文件

         FileClose($search)                           ;;;则关闭此句柄
         return                                                   ;;;返回
    Elseif$file = "."or $file = ".." Then    ;;如果找到的文件名为.或..则 ContinueLoop
         ContinueLoop                                    ;;;在某些版本的AU3里面可以不需要上行和这行。
    ElseIf stringinstr(FileGetAttrib($searchdir & "\" & $file),"D") then      ;;如果找到的是一个文件夹,则
         _filelist($searchdir & "\" & $file)    ;;递归调用filelist函数,并传参数"$searchdir & "\" & $file"

    EndIf                                                          ;;;$file为查找到的文件夹名称,上一行意思就是进入此文件夹继续查找文件.如此循环
    ConsoleWrite( $searchdir & "\" & $file & @crlf )
WEnd
EndFunc

qq342252004 发表于 2008-5-19 23:52:38

清除系统垃圾au3代码

清除系统垃圾au3代码

skyfree 发表于 2008-5-26 07:44:00

……

大不了用AU3生成这份BAT,隐藏运行BAT后再把这个BAT删了……

zgb 发表于 2008-5-27 20:05:27

http://www.autoitx.com/forum.php?mod=viewthread&tid=876

lichenyao 发表于 2009-6-17 22:25:42

:face (31):

lichenyao 发表于 2009-6-17 22:25:51

:face (31):

都市浪子666 发表于 2009-6-19 21:24:16

偶还是喜欢这样,生成一个批处理文件,然后隐藏运行批处理文件,之后删除。呵呵

水饺睡觉 发表于 2010-7-3 02:04:46

楼主可以用AU3调用批处理
页: [1]
查看完整版本: 如何用AU3删除系统垃圾