下面这段程式在VBA底下可以正常执行
存成.vbs之后 执行时没有异常讯息
但是也没有任何执行效果
没有移动任何档案甚至连建立新的资料夹都没有
有人可以告诉我是出了什么问题吗
谢谢大家
Sub FileSeparator()
Dim FSO, MyFiles
Dim DateLastModified, FileName, FolderPath
Dim FileInfo
FolderPath = "D:\TEST"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set MyFiles = FSO.getfolder(FolderPath)
For Each FileInfo In MyFiles.Files
FileName = FileInfo.Name
DateLastModified = Format(FileInfo.DateLastModified, "YYMMDD")
If Not FSO.FolderExists(FolderPath & "\" & DateLastModified) Then
FSO.CreateFolder (FolderPath & "\" & DateLastModified)
End If
FSO.MoveFile FolderPath & "\" & FileName, FolderPath & "\
" & DateLastModified & "\"
Next
End Sub