[VBA ] vbs程序呼叫或引数不正确

楼主: vernc (cralvin)   2023-04-15 13:22:21
Dim fso, folder, files
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder("R:\e") ' 取代为目标目录的路径
Set files = folder.Files
msgbox files.Count
If files.Count > 0 Then ' 检查目录下是否有档案
files(files.Count - 1).Delete ' 删除目录下最后一个档案
End If
Set files = Nothing
Set folder = Nothing
Set fso = Nothing
GPT写的,第8行出问题
WScript.Echo files.Item(0).Name
上面这行也"程序呼叫或引数不正确"
那位教教是那出错?
GPT&BING怎么问都说没错
thx
作者: MOONRAKER (㊣牛鹤鳗毛人)   2023-04-16 09:59:00
继续问ChatGPT问到他招供阿

Links booklink

Contact Us: admin [ a t ] ucptt.com