找回密码
 加入
搜索
查看: 6151|回复: 13

[AU3基础] 想制作一个清理系统垃圾工具但不会连接进度条

 火.. [复制链接]
发表于 2011-3-17 11:56:47 | 显示全部楼层 |阅读模式
本帖最后由 lzlcn 于 2011-3-17 11:58 编辑

想制作一个清理系统垃圾工具但不会连接进度条,但怎么连接进度条呢。并在右下角提示处时时显示删除的内容最佳!
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 352, 120, 267, 300)
$Button1 = GUICtrlCreateButton("清理系统垃圾文件", 56, 16, 123, 33)
$Button2 = GUICtrlCreateButton("退出", 224, 16, 81, 33)
$Progress1 = GUICtrlCreateProgress(8, 72, 337, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $Button1
                        ToolTip(@CR & '  正在清除系统垃圾,请稍候...  ' & @CR, @DesktopWidth - 250, @DesktopHeight - 100)
                 RunWait(@ComSpec & " /c " & "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%\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\*.*", "", @SW_HIDE)

                 MsgBox(64, "提示", "清除完毕!", 5)
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button2
                        Exit
                

        EndSwitch
WEnd

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2011-3-17 12:26:59 | 显示全部楼层
本帖最后由 guang19831217 于 2011-3-17 12:31 编辑

帖子11 精华0 积分16 威望0 点 金钱1007 块

大大你好厉害哦。

支持下。偶也想知道cmd怎么精确做到。
发表于 2011-3-17 12:30:09 | 显示全部楼层
学习下 O(∩_∩)O哈哈~
发表于 2011-3-17 13:08:47 | 显示全部楼层
我在虚机里,不方便,没有au3环境, 实现方法这样成么?
你用run 这个垃圾清理,返回一下PID 然后: do until 来更新进度条, 直到这个pid运行结束没有了...
会了吧?
 楼主| 发表于 2011-3-17 15:31:43 | 显示全部楼层
回复 4# boyhong

不好意思,还是新手,不懂pid是什么。还望能提供下代码
发表于 2011-3-17 15:39:45 | 显示全部楼层
顶一下,...也想知道
发表于 2011-3-18 08:30:42 | 显示全部楼层
不会进度条,看看,学习学习。。
发表于 2011-3-18 10:28:33 | 显示全部楼层
这个要学习学习```
发表于 2011-3-19 11:17:10 | 显示全部楼层
6#的办法也是可以的
 楼主| 发表于 2011-3-19 14:10:00 | 显示全部楼层
回复 6# sliqi


    确实是一个方法。赞一个
发表于 2011-3-19 18:12:47 | 显示全部楼层
贴一个脚本,花钱买的
希望对你有帮助

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2011-3-19 18:13:54 | 显示全部楼层
还有一个 漏掉了 补上
这是论坛中找到的 希望有帮助:-)
Dim $wizard,$landy,$size,$down;定义变量
$wizard="  http://www.duote.com/server/getfile.php?uri=http://41.duote.org/znabc5.23.exe&id=907";定义下载地址
$landy="c:\智能Abc.exe";定义下载存入的地址
$down=InetGet($wizard , $landy,1,1 );开始下载,后面的两个 1 请参考帮助
ProgressOn("智能ABC","正在下载,请稍后....");创建进度条
While 1 ;设置进度百分比的循环体
        If InetGetInfo($down,2) = True Then ExitLoop;如果下载完成,就会为真,就会退出这个循环
        $BFB = Round(InetGetInfo($down,0) / InetGetInfo($down,1),2) * 100;计算出百分比 
        TrayTip(InetGetInfo($down,0),InetGetInfo($down,1),10);这里是用来调试的,可以去除
        ProgressSet($BFB,'已经下载了: ' & $BFB & '%');显示出来
        Sleep(100)
WEnd;循环体结束;当然要在条件不成立的情况下。
ProgressSet(100,"下载完成了!");最后这里设置成下载完成,不设置也可, 因为用户只会看到一个一闪而过的画面
ProgressOff();关闭进度条
If MsgBox(32+4,'提示','已经下载完成了, 是否打开文件 ?') = 6 Then;如果用户点了 “是” 得到的值就会是6,条件成立,就会执行下面的
        Run($landy);运行下载过来的文件 
EndIf
发表于 2011-3-24 09:26:50 | 显示全部楼层
学习了,楼主
发表于 2011-3-25 13:29:53 | 显示全部楼层
感谢fhefh...............
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-24 03:15 , Processed in 0.086439 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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