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