Dim FolderDate = Format(DateSerial(Year(Now()), Month(Now()), 0), "yyyy-mm")
Dim d As New IO.DirectoryInfo("C:\SourceFolder\")
Dim Destinationfolder As String = "C:\Test Folder\"
Dim f As IO.FileInfo
For Each f In d.GetFiles("*.pdf")
Dim FName As String = f.Name.Substring(0, f.Name.LastIndexOf("."))
FName = FName.Substring(0, 6)
MessageBox.Show(FName)
MessageBox.Show(f.FullName)
Dim path As String
path = Destinationfolder & FName
Dim subdi = path & "\" & FolderDate
'Try
' Determine whether the directory exists.
If Directory.Exists(path) Then
'Return
End If
If Directory.Exists(subdi) Then
End If
' Try to create the directory.
Dim di As DirectoryInfo = Directory.CreateDirectory(path)
Console.WriteLine("The directory was created successfully at {0}.", Directory.GetCreationTime(path))
System.IO.File.Copy(f.FullName, subdi & "\" & f.Name, True)
'Catch e As Exception
' Console.WriteLine("The process failed: {0}.", e.ToString())
'End Try
Next
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE