- 帖子
- 766
- 积分
- 1451
- 技术
- 117
- 捐助
- 0
- 注册时间
- 2010-5-12
|
4# Demon
好象没有效果!
q115643492 发表于 2011-7-11 12:56
上面的代码是在Windows 7中测试的,刚刚在Windows 2003中测试了一下,发现和Windows 7不太一样。
Windows 7下窗口可以分成Windows Internet Explorer、Windows Explorer两种,前者是IE窗口,后者是Explorer窗口,但是在Windows 2003中没有作区分,只有Windows Internet Explorer一种窗口,所以上面代码的If条件不成立。
既然这样,就不加If判断了
'Author: Demon
'Website: http://demon.tw
'Date: 2011/7/11
Option Explicit
Dim shell, window, path
Set shell = CreateObject("Shell.Application")
For Each window In shell.Windows
path = Mid(window.LocationURL, 9)
Select Case path
Case "D:/", "D:/a"
window.Quit
End Select
Next
|
-
1
评分人数
-
|