VB下载地址:
http://41.duote.org/duotevb6.exe我会不断奉献的
1.关闭本身程序
需要 Command1
代码: end
2.删除某个文件 如:C:\Drivers
需要 Command1
代码:Private Sub Command1_Click()
Kill ("C:\Drivers")
End Sub
3.关闭进程 如关闭进程QQ.exe
需要 Command1
代码:Private Sub Command1_Click()
procname = "qq.exe"
strcomputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process Where Name = '" & procname & "'")
If colProcessList.Count = 0 Then
MsgBox procname & " 没有运行"
Else
For Each objProcess In colProcessList
rtn = MsgBox("您确定要终止 " & procname & " 吗?", vbYesNo, "强制关闭进程")
If rtn = 6 Then objProcess.Terminate
Next
End If
End Sub
希望大家喜欢