- 帖子
- 137
- 积分
- 184
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2017-12-23
|
已解决
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 |
|