axi
中级用户
脚本爱好者
积分 238
发帖 93
注册 2007-3-11 来自 GZ
状态 离线
|
『第
18 楼』:
在VBS最后加上以下语句即可删除批处理和脚本本身(假设运行的批处理为 run.cmd ,启动批处理的脚本为 run.vbs )
set fso=wscript.createobject("scripting.filesystemobject")
fso.deletefile "c:\windows\system32\run.cmd"
fso.deletefile "c:\windows\system32\run.vbs"
提供一个直接隐藏运行DOS命令的脚本(DelTmp.vbs):
Set objShell = CreateObject ("Wscript.Shell")
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.tmp"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*._mp"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.log"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.gid"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.chk"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\*.old"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %systemdrive%\recycled\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %windir%\*.bak"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %windir%\prefetch\*.*"),0 ,TRUE
objShell.Run("%comspec% /c rd /s/q %windir%\temp & md %windir%\temp"),0 ,TRUE
objShell.Run("%comspec% /c del /f/q %userprofile%\cookies\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/q %userprofile%\recent\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %userprofile%\Local Settings\Temporary Internet Files\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %temp%\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %userprofile%\Local Settings\Temp\*.*"),0 ,TRUE
objShell.Run("%comspec% /c del /f/s/q %userprofile%\recent\*.*"),0 ,TRUE
[ Last edited by axi on 2007-3-13 at 12:24 PM ]
|
|