Try:
Dim fso
set fso = CreateObject("Scripting.Fi
fso.CopyFile " C:\Program Files\PARKINVT\PARK_INVT.m
set fso = nothing
msgbox "Done!"
Main Topics
Browse All TopicsHi Everyone -
I need to preform a daily backup of a file by copying an .mdb from one location (Location = C:\Program Files\PARKINVT) renaming it by including the date and time in the field name (File Name = PARK_INVT.mdb), and copying to a backup storage location (Backup Storage Location = c:\Program Files\PARKINVT\BACKUPS). Can some one help me on this?
Thanks In Advance!
Kev
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
If want to include time, just use:
fso.CopyFile "C:\Program Files\PARKINVT\PARK_INVT.m
btw, are you executing the vbscript in a .vbs file or in a VB application? FYI, Format function is Not allowed in vbscripts writtin in a .vbs file.
QUOTE "btw, are you executing the vbscript in a .vbs file or in a VB application? FYI, Format function is Not allowed in vbscripts writtin in a .vbs file."
I am executing the VBScript in a .vbs file not a VB Application. Are you saying the FormatDateTime function won't work in a .vbs file? Just wanted to clarify as I copied what you provided above and it works perfectly..?
Also - would be willing to throw in another 65 points (all I have left!) if you could tell me how - using the fso.CopyFile method I could copy all files from one location (without knowing the exact names of the files) to another. If not, no biggie I'll award you the 125 as offered with the question.
Thanks Again for the help - really appreciate it!
Kev
Here the method to copy all files in directory to another folder:
Dim fso As New FileSystemObject
Dim f As Folder, sf As Folder, path As String, newName as String
path = "C:\Program Files\PARKINVT\"
Set f = fso.GetFolder(path)
'Iterate through subfolders.
For Each sf In f.SubFolders
newName=sf.Path & "\backup\" & sf.Name
fso.CopyFile sf.Path & "\" & sf.Name, newName
Next
set fso=nothing
Business Accounts
Answer for Membership
by: Michael_DPosted on 2004-04-18 at 08:20:09ID: 10853641
What do you mean by saying VBScript?
1) If it's just script (or code) written in VB than you can use this:
Dim Location as String
Dim BackupLocation as String
Dim FileName as String
Dim BacupFileName as String
Location = C:\Program Files\PARKINVT
BackupLocation = c:\Program Files\PARKINVT\BACKUPS
FileName="PARK_INVT.mdb"
BacupFileName ="PARK_INVT_" & Format$(Now(),"d-m-yy h-mm") & ".mdb"
FileCopy Location & "\" & FileName, BackupLocation & "\" & BacupFileName
2) If you want to copy file from ASP Page using <SCRIPT language="VBScript"> and bacup files on server let me know and i'll show you how to do it
Regards,
Michael