|
-
Sep 6th, 2004, 03:01 AM
#1
Thread Starter
Addicted Member
Batch File Backup (Resolved)
Hi, im trying to make a batch file that copies a directory on one drive, and creates a new directory named the current date on another and dumps the data there.
this is to backup the contents of that directory
below is what i want to do
make dir
C:\UNI_BACKUP\{date}
({date} being todays date)
copy
D:\FILE_SVR\UNI to C:\UNI_BACKUP\{date}
thanks for ya help people
Last edited by señorbadger; Sep 6th, 2004 at 04:15 AM.
-
Sep 6th, 2004, 03:32 AM
#2
Date /t will get the current date for you, but i dunno how to pass it as an argument in a batch file.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
-
Sep 6th, 2004, 04:14 AM
#3
Thread Starter
Addicted Member
Thanks for ya help
made a vbscript file instead
VB Code:
Dim fso
dim today
dim dirname
set fso = CreateObject("Scripting.FileSystemObject")
today = Replace(date,"/","-")
dirname = "C:\UNI_BACKUP\" & today
msgbox dirname
fso.CreateFolder(dirname)
fso.CopyFolder "D:\FILE_SVR\UNI", dirname
msgbox "Backup completed saved to " & dirname
set fso = nothing
thanks again
-
Sep 6th, 2004, 10:13 PM
#4
I was just about to suggest that, good to hear you got it working.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|