Run的问题
$yesno=msgbox(36,"清除系统垃圾文件","是否要进行清除系统垃圾文件?")if $yesno=6 then
Run(@ComSpec & " /c " & "Del /f /s /q /a %SysTemRoot%\*.bmp","", @SW_HIDE);Windows自带的墙纸.
Run(@ComSpec & " /c " & "Del /f /s /q /a %SysTemRoot%\Web\Wallpaper\*.*","", @SW_HIDE);Windows自带的墙纸.
Run(@ComSpec & " /c " & "Del /f /s /q /a %SysTemRoot%\*.scr","", @SW_HIDE);Windows自带的屏幕保护程序.
Run(@ComSpec & " /c " & "Del /f /s /q /a %SysTemRoot%\Temp\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %SysTemRoot%\Temp\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /q /a %SysTemRoot%\*.txt","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %SysTemdrive%\*.tmp","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %SysTemdrive%\*._mp","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %SysTemdrive%\*.log","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %SysTemdrive%\*.gid","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %SysTemdrive%\*.chk","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %SysTemdrive%\*.old","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %WinDir%\*.bak","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %systemdrive%\Thumbs.db","", @SW_HIDE);缩略图缓冲文件.
Run(@ComSpec & " /c " & "Del /f /s /q /a %WinDir%\prefetch\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /q /a %UserProfile%\cookies\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %UserProfile%\recent\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %UserProfile%\Local Settings\Temporary Internet Files\*.*","", @SW_HIDE);IE临时文件.
Run(@ComSpec & " /c " & "Del /f /s /q /a %UserProfile%\Local Settings\Temp\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %systemdrive%\recycled\*.*","", @SW_HIDE);回收站里的文件.
Run(@ComSpec & " /c " & "Del /f /s /q /a %UserProfile%\Local Settings\Temp\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Rd /s /q %WinDir%\Temp & Md %WinDir%\Temp","", @SW_HIDE);系统临时文件.
Run(@ComSpec & " /c " & "del /s /q %systemdrive%\Program Files\InstallShield Installation Information\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q %UserProfile%\recent\*.*","", @SW_HIDE)
msgbox(48,"","你已成功清除了系统垃圾!")
EndIf
这里有好多在我机器上不能用我的系统是SP3的
比如:Run(@ComSpec & " /c " & "del /s /q %systemdrive%\Program Files\InstallShield Installation Information\*.*","", @SW_HIDE)
:Run(@ComSpec & " /c " & "Del /f /s /q /a %UserProfile%\recent\*.*","", @SW_HIDE)
都不好用,是这个程序那里出的问题还是别的?
请明白的教教我!!!谢谢:face (36):
[ 本帖最后由 clea01 于 2008-8-10 19:51 编辑 ] 单条命令是可以执行的!试用runwait() 还是不行呀?
就拿这条来说
Run(@ComSpec & " /c " & "del /s /q %systemdrive%Program FilesInstallShield Installation Information*.*","", @SW_HIDE)
我在C:Program FilesInstallShield Installation Information里新建了一个为本.
运行这条语句一点反映都没有!~~~~:face (36): 你直接写写这行批处理看执行么??对带有空格的命令要怎么处理,楼主似乎应该补习一下批处理相关知识了。 Run(@ComSpec & " /c " & "del /s /q %systemdrive%Program FilesInstallShield Installation Information*.*","", @SW_HIDE)
批处理
c:>del /s /q "%ProgramFiles%InstallShield Installation Information"\*.*
楼上的说的很对,是长文件夹的问题,现在就差这几个没解决了?
Run(@ComSpec & " /c " & "Del /f /q /a %UserProfile%\cookies\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %UserProfile%\recent\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %UserProfile%\Local Settings\Temp\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %UserProfile%\Local Settings\Temporary Internet Files\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "del /s /q %ProgramFiles%\InstallShield Installation Information\*.*","", @SW_HIDE)
Run(@ComSpec & " /c " & "Del /f /s /q /a %systemdrive%\recycled\*.*","", @SW_HIDE)
问题是在Run里怎么写?你可以教教我吗?我才学这个不久~~~~谢谢:face (36):
[ 本帖最后由 clea01 于 2008-8-10 16:56 编辑 ] RunWait(@ComSpec & " /c " & "Del /f /s /q /a "&'"'&@UserProfileDir&'\Local Settings\Temp\*.*"',"", @SW_HIDE)
其它的依此类推
Run里可不可以加变量
Run(@ComSpec & " /c " & 'Del /f /q /a "%UserProfile%\Cookies"\*.*',"", @SW_HIDE)谢谢!
这样写也可以用!刚刚搜到的!~~~~不过要谢谢版主!:face (15):
对了,版主在Run里可不可以加变量 Run里是可以使用变量的建议你看《FAQ 大全》初学者必看
http://www.autoitx.com/forum.php?mod=viewthread&tid=175&extra=page%3D1
不要随便更改标题....把你的标题改回去,避免后人搜索答案的误差! 已经改好了
页:
[1]