Exception:
Move File or Copy File:
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
Solution Tried:
Directory.GetFiles(“yourdirpath”).[Select](Function(f) New FileInfo(f)).Where(Function(f) f.CreationTime = DateTime.Now AndAlso f.Extension.Equals(“.pdf”) ).ToList()
(Same issues)
Tried Macro
Working fine
Sub FSOMoveAllFiles ()
Dim FSO As New FileSystemObject
Dim FromPath As String
Dim ToPath As String
Dim FileInFromFolder As Object
FromPath = “A1”
ToPath = “A2”
Set FSO = CreateObject(“Scripting.FileSystemObject”)
For Each FileInFromFolder In FSO.GetFolder(FromPath).Files FileInFromFolder.Move ToPath Next FileInFromFolder
End Sub
@mukeshkala @Vibhor.Shrivastava @Vrinda_Jain @nisargkadam23 @Lahiru.Fernando @seanrockvz13 @StefanSchnell