这就是我所拥有的。为什么根本不导出文件?如果我删除" sdate" Set NewFile行的一部分工作正常。
On Error Resume Next
Dim fso, folder, files, sFolder, sDate
sDate = Date
Set fso = CreateObject("Scripting.FileSystemObject")
sFolder = "\\mypath" 'Wscript.Arguments.Item(0)
If sFolder = "" Then
Wscript.Echo "No Folder parameter was passed"
Wscript.Quit
End If
Set NewFile = fso.CreateTextFile(sFolder& "\Refunds" & sDate & ".csv", True)
Set folder = fso.GetFolder(sFolder)
Set files = folder.Files
For each folderIdx In files
NewFile.WriteLine(Replace(Replace(folderIdx.Name,"_",","), ".pdf",""))(folderIdx.Name)
Next
NewFile.Close
x=msgbox("CSV list complete." ,0, "Done")
答案 0 :(得分:0)
替换
行sDate = Date
与
sDate = Replace(Date, "/", "-")
另外,为确保您的脚本适用于具有其他语言设置的PC,请在开头添加该行
SetLocale(1033)