本帖最后由 pcl_test 于 2018-4-2 09:12 编辑
- fdpath="D:\123\test"
-
- arr=Split("%,{,},[,],&,^,#,`, ", ",")
- fdpath=Replace(fdpath, "\", "/")
- If Right(fdpath, 1) = "/" Then fdpath=Left(fdpath, Len(fdpath)-1)
- If Len(fdpath) = 2 Then fdpath=fdpath & "/"
-
- Set ShellApp = CreateObject("Shell.Application")
- Set oWindows = ShellApp.Windows
- For Each SubWds In oWindows
- If LCase(SubWds.LocationURL) = LCase("file:///" & encode(fdpath, arr)) Then
- SubWds.Quit()
- End If
- Next
-
- Function encode(ByVal path, ByRef arr)
- For i=0 To UBound(arr)
- path=Replace(path, arr(i), "%" & Hex(Asc(arr(i))))
- Next
- encode=path
- End Function
复制代码
|