站长资源脚本专栏

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

整理:jimmy2024/12/28浏览2
简介set ws=createobject("wscript.shell") set fso=createobject("scripting.filesystemobject") set folder=fso.getfolder(ws.currentdirectory) set files=folder
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