' Get the current Date Time and remove illegal chars
Dim strDTStamp As String = Format(Date.Now, "yyyyMMddHHmmss")
' This is the file we want to rename
Dim of As String = "C:\Myfile.txt"
' Insert DTStamp into the old name
Dim nf As String = of.Replace(".", strDTStamp & ".")
' Moving the file is like renaming it
System.IO.File.Move(of, nf)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment