找回密码
 加入
搜索
查看: 4283|回复: 3

如何隐藏运行窗口

[复制链接]
发表于 2008-5-30 12:44:26 | 显示全部楼层 |阅读模式
FileInstall ( "清理系统垃圾文件.bat", @TempDir&"\清理系统垃圾文件.bat" ,1 )
RunWait ( @TempDir&"\清理系统垃圾文件.bat")
FileDelete ( @TempDir&"\清理系统垃圾文件.bat" )

请教:我如何才能把正在运行的清理系统垃圾文件.bat窗口隐藏起来?
 楼主| 发表于 2008-5-30 12:49:48 | 显示全部楼层
加了@SW_HIDE 代码也不行
RunWait ( @TempDir&"\清理系统垃圾文件.bat", @SW_HIDE )


我少加了""这个难怪不行。
RunWait ( @TempDir&"\清理系统垃圾文件.bat","",@SW_HIDE)

这问题解决了,新问题又来了,试运行了下及检查了下,发现不隐藏运行清理系统垃圾文件.bat窗口,垃圾清理得很干净,但运行清理系统垃圾文件.bat窗口隐藏起来,垃圾清理就不干净。这是啥原因?请高手帮指点分析下!

[ 本帖最后由 番茄 于 2008-5-30 13:37 编辑 ]
 楼主| 发表于 2008-5-30 13:37:06 | 显示全部楼层
清理垃圾文件.bat:
Echo 正在检查cookies、历史纪录等目录位置(当前用户)……
reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cookies>>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v History>>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v NetHood>>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Recent>>%temp%\cleantmp.txt
Echo 正在清理Cookies、IE缓存、历史纪录等(当前用户)……
For /f "tokens=3*" %%a In (%temp%\cleantmp.txt) Do (
  For /d %%i In ("%%a %%b\*.*") Do rd /s /q "%%i"
  Del /a /f /s /q "%%a %%b\*.*"
)
::跟上面几项未必是重复的(!),也是对当前用户目录
Echo 正在清理临时文件 (系统目录)……
Del /a /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
Del /a /f /s /q "%userprofile%\Local Settings\Temp\*.*"
Del /a /f /s /q "%userprofile%\Locals~1\Tempor~1\*.*"
Del /a /f /s /q "%userprofile%\Locals~1\Temp\*.*"
Del /a /f /s /q "%userprofile%\cookies\*.*"
Del /a /f /s /q "%userprofile%\recent\*.*"
Del /a /f /s /q "%Temp%\*.*"
Del /a /f /s /q "%Tmp%\*.*"
Del /a /f /s /q "%HomePath%\..\IconCache.db"
Echo 正在清理系统目录中的垃圾文件 (稍候,需要点时间)……
Del /a /f /s /q "%systemdrive%\*._mp"
Del /a /f /s /q "%systemdrive%\*.log"
Del /a /f /s /q "%systemdrive%\*.dmp"
Del /a /f /s /q "%systemdrive%\*.gid"
Del /a /f /s /q "%systemdrive%\*.old"
Del /a /f /s /q "%systemdrive%\*.tmp"
Del /a /f /s /q "%systemdrive%\*.syd"
Del /a /f /s /q "%systemdrive%\*.pf"
Del /a /f /s /q "%systemdrive%\*.ftg"
Del /a /f /s /q "%systemdrive%\*.fts"
Del /a /f /s /q "%systemdrive%\*.prv"
Del /a /f /s /q "%systemdrive%\*.diz"
Del /a /f /s /q "%systemdrive%\*.dmp"
Del /a /f /s /q "%systemdrive%\*.spc"
Del /a /f /s /q "%systemdrive%\*.cdr"
Del /a /f /s /q "%systemdrive%\*.mch"
Del /a /f /s /q "%systemdrive%\*.chk"
Del /a /f /s /q "%systemdrive%\recycled\*.*"
Del /a /f /s /q "%windir%\prefetch\*.*"
Del /a /f /s /q "%windir%\recent\*.*"
Del /a /f /s /q "%windir%\*.bak"
Del /a /f /s /q "%SystemRoot%\*.bak"
Del /a /f /s /q "%SystemRoot%\*.query"
rd /s /q "%SystemRoot%\Downloaded Program Files"
rd /s /q "%SystemRoot%\Offline Web Pages"
rd /s /q "%systemroot%\Connection Wizard"
rd /s /q "%SystemRoot%\SoftwareDistribution\Download"
rd /s /q "%SystemRoot%\Assembly"
rd /s /q "%SystemRoot%\Help"
rd /s /q "%SystemRoot%\system32\ReinstallBackups"
rd /s /q %temp% & md %temp%
rd /s /q %windir%\temp & md %windir%\temp
Del /a /s /q "%SystemRoot%\inf\*.pnf"
Del /a /f /s /q "%SystemRoot%\inf\InfCache.1"
dir %SystemRoot%\inf\*.* /ad/b >%SystemRoot%\vTmp.txt
For /f %%a In (%SystemRoot%\vTmp.txt) Do rd /s /q "%SystemRoot%\inf\%%a"
Del /a /f /s /q "%SystemRoot%\Driver Cache\*.pnf"
Del /a /f /s /q "%SystemRoot%\Driver Cache\InfCache.1"
Del /a /f /s /q "%SystemRoot%\system32\drivers\*.pnf"
Del /a /f /s /q "%SystemRoot%\system32\drivers\InfCache.1"
rd /s /q "%SystemRoot%\temp" & md "%SystemRoot%\temp"
Del /a /f /s /q "%SystemRoot%\Prefetch\*.*"
Del /a /f /s /q "%SystemRoot%\minidump\*.*"
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\URLSearchHooks" /f
reg add "HKCU\Software\Microsoft\Internet Explorer\TypeURLs" /f
echo 正在清除D盘垃圾文件,请稍等......
del /f /s /q "D:\*.tmp"
del /f /s /q "D:\*._mp"
del /f /s /q "D:\*.log"
del /f /s /q "D:\*.gid"
del /f /s /q "D:\*.chk"
del /f /s /q "D:\*.old"
Echo 正在清除无用的磁盘检错文件 (系统分区)……
Del /a /f /q "%SystemDrive%\*.chk"
dir %SystemDrive%\found.??? /ad/b >%SystemRoot%\vTmp.txt
For /f %%a In (%SystemRoot%\vTmp.txt) Do rd /s /q "%SystemDrive%\%%a"
Echo 正在清理系统升级补丁留下来的反安装目录 (已修正能正确清除)……
dir %SystemRoot%\$*$ /ad/b >%SystemRoot%\vTmp.txt
For /f %%a In (%SystemRoot%\vTmp.txt) Do rd /s /q "%SystemRoot%\%%a"
Echo 正在清除常见的软件垃圾项目 (按默认目录)……
rd /s /q "%ProgramFiles%\InstallShield Installation Information"
Ren "%ProgramFiles%\Common~1\Real\Update_OB\realsched.exe" realsched.ex_
Del "%ProgramFiles%\Common~1\Real\Update_OB\realsched.exe"
Reg Delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v TkBellExe /f
rd /s /q "%ProgramFiles%\Tencent\QQGame\Download"
taskkill /f /im "TIMPlatform.exe" /t
Del /a /f /s /q "%ProgramFiles%\Kaspersky Lab\*.tmp"
Echo 正在删除运行QQ和Real时启动的多余程序……
del /f /s /q C:\Progra~1\Tencent\QQ\TIMPlatform.exe
del /f /s /q D:\Progra~1\Tencent\QQ\TIMPlatform.exe
taskkill  /im realsched.exe /f
del /f /s /q C:\Progra~1\Common~1\Real\Update_OB\realsched.exe
Echo 正在清除运行记录……
reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /va /f
Echo.
exit
发表于 2008-5-30 15:10:32 | 显示全部楼层
窗口隐藏运行的时候,是不是有可能还没完全运行完就关闭删除了.不太清楚,有待高手进一步解答.

另外,不知LZ为什么要把批处理Copy到系统目录,运行后再删除.
试下去掉RunWait前后两句试试
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-19 20:46 , Processed in 0.076949 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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