Results 1 to 4 of 4

Thread: Batch File Backup (Resolved)

  1. #1

    Thread Starter
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193

    Question 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.

  2. #2
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718
    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)

  3. #3

    Thread Starter
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193
    Thanks for ya help

    made a vbscript file instead

    VB Code:
    1. Dim fso
    2. dim today
    3. dim dirname
    4. set fso = CreateObject("Scripting.FileSystemObject")
    5.     today = Replace(date,"/","-")
    6.     dirname = "C:\UNI_BACKUP\" & today
    7.     msgbox dirname
    8.         fso.CreateFolder(dirname)
    9.      
    10. fso.CopyFolder "D:\FILE_SVR\UNI", dirname
    11. msgbox "Backup completed saved to " & dirname
    12. set fso = nothing
    thanks again

  4. #4
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718
    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
  •  



Click Here to Expand Forum to Full Width