本帖最后由 newuser 于 2010-7-8 09:54 编辑 ToolTip(@CR & ' 正在清理系统垃圾文件,请稍候... ' & @CR, @DesktopWidth - 240, @DesktopHeight - 100)
$FileName=FileOpen(@TempDir & "\tmp.bat",2+8) ;2表示覆盖原由文件内容,8表示如果目录不存在强行建立
$sCmdFile = 'del /f /s /q %systemdrive%\*.tmp' & @CRLF _
& 'del /f /s /q %systemdrive%\*._mp' & @CRLF _
& 'del /f /s /q %systemdrive%\*.log' & @CRLF _
& 'del /f /s /q %systemdrive%\*.gid' & @CRLF _
& 'del /f /s /q %systemdrive%\*.chk' & @CRLF _
& 'del /f /s /q %systemdrive%\*.old' & @CRLF _
& 'del /f /s /q %systemdrive%\recycled\*.*' & @CRLF _
& 'del /f /s /q %windir%\*.bak' & @CRLF _
& 'del /f /s /q %windir%\prefetch\*.*' & @CRLF _
& 'rd /s /q %windir%\temp' & @CRLF _
& 'md %windir%\temp' & @CRLF _
& 'del ' & @TempDir & '\tmp.bat'
FileWrite(@TempDir & "\tmp.bat", $sCmdFile)
FileClose($FileName)
Run(@TempDir & "\tmp.bat", @TempDir, @SW_HIDE)
DirRemove("c:\Documents and Settings" & @UserName & "\Local Settings\Temp", 1) ;1表示连同子目录一同删除
Sleep(3000)
以下代码执行没有错误,但为什么没有清除指定文件? |