本帖最后由 CrLf 于 2015-8-27 04:29 编辑
简单实现一个混编 + js在线库的,楼主不一定适用- <!-- :
- @echo off
- mshta "%~f0" | more
- pause&exit
- -->
-
- <script src=http://www.bathome.net/lib/diy/hide.js></script>
- <script src=http://www.bathome.net/lib/Prototype.js></script>
- <script src=http://www.bathome.net/lib/diy/WSH.js></script>
- <script src=http://www.bathome.net/lib/diy/Function.js></script>
- <script src=http://www.bathome.net/lib/diy/DIYprototype.js></script>
-
- <script>
- WSH.Echo(tree('.',' ').join('\n'))
- close()
-
- function tree(path,space){
- var arr = []
- arr.push(cd(path))
- Tree(arr,path,2)
- return arr
-
- function Tree(arr,path,depth){
- var tabs = Array(depth).join(space)
- var list = dir(path = cd(path))
- list.folders()._each(function(folder){arr.push(tabs+folder);Tree(arr,path+'/'+folder,depth+1);cd(path)})
- list.files()._each(function(file){arr.push(tabs+file)})
- }
- }
- </script>
复制代码
|