Board logo

标题: echo输出 [打印本页]

作者: 小渣飞    时间: 2018-4-6 21:32     标题: echo输出

本帖最后由 小渣飞 于 2018-4-6 21:33 编辑

用批处理echo输出一下完整内容,价格微信私聊 微信号 13530874825


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

特殊字符比较多的时候echo命令不方便,可以试试这样:批处理动态生成指定内容的脚本
http://bbs.bathome.net/viewthread.php?tid=32419#pid155779
http://bbs.bathome.net/viewthread.php?tid=33399#pid159265




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2