用vbs遍历文件并随机显示的脚本
时间:2021-07-06 10:08:54|栏目: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
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
上一篇:VBS 数字转英文代码
栏 目:VBS
下一篇:拖拽文件显示文件路径的vbs代码
本文标题:用vbs遍历文件并随机显示的脚本
本文地址:http://www.codeinn.net/misctech/153359.html