首页 > 编程 > VBScript > 正文

用vbs遍历文件并随机显示的脚本

2020-07-26 12:00:01
字体:
来源:转载
供稿:网友
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
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表