KMKeller
asked on
Append datestamp to all files in a directory
I need a script that will allow me to append the datestamp of each file in a directory to each filename. For example;
Would become;
Name Date Modified
test1.txt 6/18/2013
Joeresume.doc 7/12/2013
test1.txt 6/18/2013
Joeresume.doc 7/12/2013
Would become;
Name Date Modified
test1_20130618.txt 6/18/2013
Joeresume_20130712.doc 7/12/2013
test1_20130618.txt 6/18/2013
Joeresume_20130712.doc 7/12/2013
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim strNow
strNow = Now()
GetDateTimeStamp = Year(strNow) & Pad2(Month(strNow)) _
& Pad2(Day(StrNow)) & Pad2(Hour(strNow)) _
& Pad2(Minute(strNow)) & Pad2(Second(strNow))
End Function
Function Pad2(strIn)
Do While Len(strIn) < 2
strIn = "0" & strIn
Loop
Pad2 = strIn
End Function