vbs关闭重复打开的窗口(win7-win10-win11测试通过)- Do
- Call guan()
- WScript.Sleep 40000
- '40秒调用一次关闭重复窗口
- Loop
- Sub guan()
- Set Shell = CreateObject("Shell.Application")
- Set Dict = CreateObject("Scripting.Dictionary")
- Set Wins = Shell.Windows
- For i=Wins.Count-1 To 0 step -1
- If Instr(LCase(Wins(i).FullName),"\explorer.exe") Then
- If Dict.Exists(Wins(i).LocationURL) Then
- Wins(i).Quit
- Else
- Dict.Add Wins(i).LocationURL,True
- End If
- End If
- Next
- End Sub
复制代码
|