用vbs遍历文件并随机显示的脚本
程序员文章站
2024-01-15 23:04:52
set ws=createobject("wscript.shell") set fso=createobject("scripting.filesys...
set ws=createobject("wscript.shell")
set fso=createobject("scripting.filesystemobject")
set folder=fso.getfolder(ws.currentdirectory)
set files=folder.files
for each file in files
d=d & file.name & ","
next
randomize
do until d = ""
s = split(d, ",")
m = ubound(s)
h = int(rnd * m)
n = s(h)
sn = sn & n & vbcr
d = replace( d, n & ",", "",1,1)
loop
msgbox sn
set fso=createobject("scripting.filesystemobject")
set folder=fso.getfolder(ws.currentdirectory)
set files=folder.files
for each file in files
d=d & file.name & ","
next
randomize
do until d = ""
s = split(d, ",")
m = ubound(s)
h = int(rnd * m)
n = s(h)
sn = sn & n & vbcr
d = replace( d, n & ",", "",1,1)
loop
msgbox sn
上一篇: ThinkPad T550笔记本怎么开启虚拟化技术?
下一篇: Nginx 介绍及日常管理的详解