用vbs遍历文件并随机显示的脚本
人气:0想了解用vbs遍历文件并随机显示的脚本的相关内容吗,在本文为您仔细讲解的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:用vbs遍历文件并随机显示的脚本,下面大家一起来学习吧。
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
加载全部内容