【发布时间】:2020-01-07 21:23:21
【问题描述】:
On Error Resume Next
Dim fso,oShell,file
Set fso = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
oShell.Run "Taskkill /F /IM mysqld.exe",0,True
file = "C:\xampp\mysql\bin\mysqld.exe"
If fso.FileExists(file) Then
fso.DeleteFile file
End If
Set oShell = Nothing
Set fso = Nothing
我尝试使用以下cmd从指定目录中杀死mysqld.exe oShell.run "WMIC PROCESS WHERE "ExecutablePath like 'C:\xampp\mysql\bin\mysqld.exe'" 删除但出现错误,即使在 cmd.exe 上运行 wmic cmd 时也会出现错误.. 其他目录下有多个进程mysqld.exe在运行,我怎样才能从指定路径中杀死并删除一个?
【问题讨论】:
标签: batch-file cmd vbscript wmic