首页 > 游戏问答
怎样用一批处理自动结束某个指定进程
觉得用来vbs比较方便,bat也可以,我的自方法是:bai
@echo off
for /l %%i in (1 1 100000) do (ping 127.1 -n 20 >nul) & (taskkill /im aaa.exe >nul)
复制代码
100000次20秒可以循du环到关机了吧?
实用点的zhi添加一dao个计划任务吧。
@echo off
taskkill /f /im explorer.exe
taskkill就是批copy处理中常用的bai结束进du程的命令,zhi/f和/im都是参数,前者表示强dao制结束,后者表示结束用图像名显示,图像名就是后面的explorer.exe了
这个在任务管理器中也很容易,打开管理器,切换到进程项,按一下e,选中explorer.exe结束即可
怎么防止进程被结束
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function ProcessNext Lib "kernel32" Alias "Process32Next" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long '
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Const TH32CS_SNAPPROCESS = &H2
Private Const TH32CS_SNAPheaplist = &H1
Private Const TH32CS_SNAPthread = &H4
Private Const TH32CS_SNAPmodule = &H8
Private Const TH32CS_SNAPall = TH32CS_SNAPPROCESS + TH32CS_SNAPheaplist + TH32CS_SNAPthread + TH32CS_SNAPmodule
Private Const MAX_PATH As Integer = 260
Private Const PROCESS_ALL_ACCESS = &H100000 + &HF0000 + &HFFF
Private Type PROCESSENTRY32
dwSize As Long
cntUseage As Long
th32ProcessID As Long
th32ModuleID As Long
cntThreads As Long
pcPriClassBase As Long
swFlags As Long
szExeFile As String * 1024
End Type
Public Sub AntiKill()
On Error Resume Next
Dim MySnapHandle As Long
Dim hProcess As Long
Dim ProcessInfo As PROCESSENTRY32
Dim Addr As Long, hMod As Long
Dim ASM(0) As Byte
Dim sProcess As String
ASM(0) = &HC3 'retn
'Debug.Print Hex(Addr)
ProcessInfo.dwSize = Len(ProcessInfo)
If ProcessFirst(MySnapHandle, ProcessInfo) <> 0 Then
Do
sProcess = Left(LCase(ProcessInfo.szExeFile), InStr(ProcessInfo.szExeFile, ".") + 3)
If sProcess = "taskmgr.exe" Then
hProcess = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessInfo.th32ProcessID)
'Debug.Print hProcess
'Debug.Print Err.LastDllError
CloseHandle hProcess
End If
Loop While ProcessNext(MySnapHandle, ProcessInfo) <> 0
End If
CloseHandle MySnapHandle
Err.Clear
End Sub
思路:
修改taskmgr.exe加载的"kernel32"中的字节改为&HC3(retn),使其直接返而使进程不被结束。
怎么一键结束指定进程
@echo off
taskkill /f /im GHCADailUi.exe
taskkill /f /im netsvchost.exe
exit
放到记事本里,保存为.bat格式,用的时候运行一下就行了
看过怎么防止租号器结束指定进程-怎么防止进程被结束还喜欢
- 2020-02-11 小小英雄租号网
- 2020-01-08 如何租赁游戏极品账号
- 2020-01-08 租号玩家们购买活动试玩订单
- 2020-01-10 清远恒大1号1别墅日租
- 2020-01-08 租号玩怎么进行注册账号,登陆怎么操作
- 2020-01-08 大吉大利今晚租号免押金的那种
- 2020-01-08 热门游戏:荒野行动小时租号
- 2020-01-08 租号营平台官方公告
- 2020-01-08 租号营平台客服
- 2020-01-08 租号营认证中心