如何使用vbs打开所在目录下的某一类型的文件?

2024-12-22 23:22:31
推荐回答(1个)
回答1:

On Error Resume next
Dim ws
Dim fso
Set ws=createobject("wscript.shell")
set fso=createobject("scripting.filesystemobject")
Set fs = fso.GetFolder(ws.currentdirectory).Files

for each x In fs
If LCase(fso.getextensionName(x))="txt" Then
ws.Run x
End if
next