
标题: [系统相关] vbs关闭重复打开的窗口(win7-win10-win11测试通过) [打印本页]
作者: ygqiang 时间: 4 天前 12:14 标题: vbs关闭重复打开的窗口(win7-win10-win11测试通过)
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
复制代码
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |