标题: [系统相关] [已解决]vbs代码功能:关闭重复窗口。如何修改成:间隔40秒,就重复执行1次? [打印本页]
作者: ygqiang 时间: 2014-11-30 20:09 标题: [已解决]vbs代码功能:关闭重复窗口。如何修改成:间隔40秒,就重复执行1次?
本帖最后由 ygqiang 于 2014-11-30 21:08 编辑
[已解决]vbs代码功能:关闭重复窗口。如何修改成:间隔40秒,就重复执行1次?- 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
复制代码
作者: ygqiang 时间: 2014-11-30 21:07
已解决!!!!- Do
- WScript.Sleep 40000
- Call guan()
- '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://www.bathome.net/) |
Powered by Discuz! 7.2 |