fdpath="c:\666"
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作者: 小渣飞 时间: 2018-4-6 21:40
有人吗脑壳疼=-=作者: 小渣飞 时间: 2018-4-7 18:21
已解决
echo fdpath=^"c:\666^" >> 1.txt
echo arr=Split(^"%%,{,},[,],^&,^^,#,`, ^", ^",^") >> 1.txt
echo fdpath=Replace(fdpath, ^"\^", ^"/^") >> 1.txt
echo If Right(fdpath, 1) = ^"/^" Then fdpath=Left(fdpath, Len(fdpath)-1) >> 1.txt
echo If Len(fdpath) = 2 Then fdpath=fdpath ^& ^"/^" >> 1.txt
echo Set ShellApp = CreateObject(^"Shell.Application^") >> 1.txt
echo Set oWindows = ShellApp.Windows >> 1.txt
echo For Each SubWds In oWindows >> 1.txt
echo If LCase(SubWds.LocationURL) = LCase(^"file:///^" ^& encode(fdpath, arr)) Then >> 1.txt
echo SubWds.Quit() >> 1.txt
echo End If >> 1.txt
echo Next >> 1.txt
echo Function encode(ByVal path, ByRef arr) >> 1.txt
echo For i=0 To UBound(arr) >> 1.txt
echo path=Replace(path, arr(i), ^"%%^" ^& Hex(Asc(arr(i)))) >> 1.txt
echo Next >> 1.txt
echo encode=path >> 1.txt
echo End Function >> 1.txt作者: Batcher 时间: 2018-4-8 12:45