ful56_uk Posted April 6, 2010 Posted April 6, 2010 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
box_l Posted April 6, 2010 Posted April 6, 2010 linky----->Create dir with current date then xcopy to it response 2 should help you. Box 1
ful56_uk Posted April 6, 2010 Author Posted April 6, 2010 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
box_l Posted April 7, 2010 Posted April 7, 2010 DEL C:\test\*.* if you have subfolders, then add /S it would be better to use robocopy though Robocopy with /MOVE check out SS64.com Command line reference for detailed commands for most OS and languages. BoX
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now