+ Post New Thread
Results 1 to 5 of 5
Scripts Thread, script to copy folder contents in Coding and Web Development; Hi guys i am after a script or a bat file that will copy the contents of a folder on ...
  1. #1
    ful56_uk's Avatar
    Join Date
    Mar 2008
    Location
    Essex
    Posts
    534
    Thank Post
    104
    Thanked 23 Times in 21 Posts
    Rep Power
    17

    script to copy folder contents

    Hi guys

    i am after a script or a bat file that will copy the contents of a folder on a local server to a network share but it creates a folder with the date and copys the contents to that folder on the share

    any ideas?

    mark

  2. #2
    box_l's Avatar
    Join Date
    May 2007
    Location
    Herefordshire
    Posts
    403
    Thank Post
    63
    Thanked 84 Times in 69 Posts
    Rep Power
    60
    linky----->Create dir with current date then xcopy to it

    response 2 should help you.

    Box

  3. Thanks to box_l from:

    ful56_uk (6th April 2010)

  4. #3
    ful56_uk's Avatar
    Join Date
    Mar 2008
    Location
    Essex
    Posts
    534
    Thank Post
    104
    Thanked 23 Times in 21 Posts
    Rep Power
    17
    love that

    cheers

  5. #4
    ful56_uk's Avatar
    Join Date
    Mar 2008
    Location
    Essex
    Posts
    534
    Thank Post
    104
    Thanked 23 Times in 21 Posts
    Rep Power
    17
    oh do you know what i would need to add to delete the contents of the source folder after it has copied?

    @echo off
    setlocal enabledelayedexpansion
    for /F "tokens=2-4 delims=/- " %%A in ('date/T') do

    set target=c:\backup\%%A%%B%%C
    xcopy "C:\test\*" "%target%\" /E /-Y

  6. #5
    box_l's Avatar
    Join Date
    May 2007
    Location
    Herefordshire
    Posts
    403
    Thank Post
    63
    Thanked 84 Times in 69 Posts
    Rep Power
    60
    Code:
    DEL C:\test\*.*
    if you have subfolders, then add
    Code:
    /S
    it would be better to use robocopy though
    Robocopy

    with
    Code:
    /MOVE
    check out SS64.com Command line reference for detailed commands for most OS and languages.

    BoX

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 5
    Last Post: 29th January 2013, 10:16 AM
  2. Script to copy folder
    By cookie_monster in forum Windows
    Replies: 5
    Last Post: 7th October 2009, 10:52 AM
  3. need a script to copy a folder with shortcuts
    By jamin100 in forum Scripts
    Replies: 1
    Last Post: 4th September 2008, 07:38 PM
  4. VB Script ti check for folder and then copy contents to PC
    By tosca925 in forum How do you do....it?
    Replies: 4
    Last Post: 2nd October 2006, 08:15 PM
  5. Replies: 2
    Last Post: 1st October 2005, 02:55 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •