Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename file with the date.....

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
I have copied some files to a zip drive and compressed them but what I would like is to be able to rename these files with the date that they were archived on....

Preferably in the format: yyyymmdd or yymmdd

I'm pretty new guys so please go easy on me with the answers!

Thanks in advance...

Marcus
 
Make a reference to microsoft scripting runtime


Option Explicit
Dim fso As FileSystemObject

Private Sub Form_Load()
Set fso = New FileSystemObject
End Sub

Private Sub Command1_Click() fso.CopyFile "c:\mydir\myfile.mdb", "C:\mynewdir\mynewfile.mdb", True
End Sub

'this way you can rename the file when you copy to a new location.
'to rename a file that already exists use this
name "myfile.mdb" as "mynewfile.mdb"


David Paulson


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top