1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
'Add file date to file name.

'Adds file date to file names meeting given file path and file mask.
'Posted to SPSSX-L list by Raynald Levesque on 2003/05/21
'rlevesque@videotron.ca http://pages.infinit.net/rlevesqu/index.htm

Sub Main
	Path$="c:\\test\\"
	F$ = Dir$(Path$ & "*.spo")
    Debug.Print F$
    While F$ <> ""
    	T$=CStr(FileDateTime(Path$ & F$))
        Debug.Print F$;" ";T$
        T$=Replace (T$,"/","-")
        Name Path$ & F$ As Path$ & Left(F$,InStr(F$,".")-1) & " " & Left(T$,InStr(T$," ")-1) & ".spo"
        F$ = Dir$()
    Wend
End Sub