mirror of
https://github.com/ihmily/DouyinLiveRecorder.git
synced 2026-03-22 07:28:24 +08:00
feat: add VB script for stopping live recording on Windows
This commit is contained in:
69
StopRecording.vbs
Normal file
69
StopRecording.vbs
Normal file
@@ -0,0 +1,69 @@
|
||||
'************************************************************************/
|
||||
'* File Name : StopRecording.vbs
|
||||
'* Creation Date : 2024-10-15 01:50:30
|
||||
'* Author : Hmily
|
||||
'* Blog : http://github.com/ihmily
|
||||
'* Description : This script is designed to terminate the process of a live
|
||||
'************************************************************************/
|
||||
|
||||
Dim objWMIService, colProcesses, objProcess
|
||||
Dim intResponse
|
||||
strComputer = "."
|
||||
On Error Resume Next
|
||||
intResponse = MsgBox("ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>ֱ̨<CCA8><D6B1>¼<EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", vbYesNo + vbQuestion, "ȷ<>Ͻ<EFBFBD><CFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
||||
|
||||
If intResponse = vbYes Then
|
||||
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
|
||||
If Err.Number <> 0 Then
|
||||
Err.Clear
|
||||
End If
|
||||
|
||||
Set colProcesses = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'ffmpeg.exe'")
|
||||
Set colProcesses2 = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'pythonw.exe'")
|
||||
Set colProcesses3 = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'DouyinLiveRecorder.exe'")
|
||||
If Err.Number <> 0 Then
|
||||
Err.Clear
|
||||
End If
|
||||
|
||||
If Not objWMIService Is Nothing And Not colProcesses Is Nothing And Not colProcesses2 Is Nothing Then
|
||||
If colProcesses2.Count = 0 And colProcesses3.Count = 0 Then
|
||||
MsgBox "û<><C3BB><EFBFBD>ҵ<EFBFBD>¼<EFBFBD>Ƴ<EFBFBD><C6B3><EFBFBD><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD>", vbExclamation, "<22><>ʾ<EFBFBD><CABE>Ϣ"
|
||||
WScript.Quit(1)
|
||||
Else
|
||||
For Each objProcess in colProcesses
|
||||
objProcess.Terminate()
|
||||
If Err.Number <> 0 Then
|
||||
objShell.Run "taskkill /f /im " & objProcess.Name, 0, True
|
||||
Err.Clear
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
objShell.Run "taskkill /f /im " & objProcess.Name, 0, True
|
||||
End If
|
||||
MsgBox "<22>ѳɹ<D1B3><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>ֱ<EFBFBD><D6B1><EFBFBD>Ľ<EFBFBD><C4BD>̣<EFBFBD>" & vbCrLf & "<22>رմ˴<D5B4><CBB4><EFBFBD>30<33><30><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD>ֹͣ¼<D6B9>Ƴ<EFBFBD><C6B3><EFBFBD>", vbInformation, "<22><>ʾ<EFBFBD><CABE>Ϣ"
|
||||
|
||||
WScript.Sleep 10000
|
||||
If colProcesses3.Count <> 0 Then
|
||||
Set colProcesses_ = colProcesses3
|
||||
Else
|
||||
Set colProcesses_ = colProcesses2
|
||||
End If
|
||||
For Each objProcess in colProcesses_
|
||||
objProcess.Terminate()
|
||||
If Err.Number <> 0 Then
|
||||
objShell.Run "taskkill /f /im " & objProcess.Name, 0, True
|
||||
Err.Clear
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
MsgBox "<22><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>", vbExclamation, "<22><>ʾ<EFBFBD><CABE>Ϣ"
|
||||
End If
|
||||
|
||||
On Error GoTo 0
|
||||
Set objWMIService = Nothing
|
||||
Set colProcesses = Nothing
|
||||
Set colProcesses2 = Nothing
|
||||
Set colProcesses3 = Nothing
|
||||
Set objProcess = Nothing
|
||||
Set objShell = Nothing
|
||||
Reference in New Issue
Block a user