0
我想创建这样的:VBS关闭所有Chrome标签
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'Chrome.exe'")
Set oShell = CreateObject("WScript.Shell")
For Each objProcess in colProcessList
oShell.Run "taskkill /im chrome.exe", , True
Next
Dim iURL
Dim objShell
iURL = "www.google.com.au"
set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "chrome.exe", iURL, "", "", 1
代码工作,但如果有太多的镀铬选项卡中打开,它并没有关闭所有标签。在关闭标签中有时还会出现一条错误消息。
谢谢,我感谢您的帮助! – theperfectcucumber