• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Help creating batch file for nightly file copy

Joined
Apr 16, 2012
Thread starter #1
I need to backup/copy the mapped Z:\fileshares on 2K3 server to D:\bk on 2K8 server folder that has 3 folders each containing an Access database. This folder is located on a Windows Server 2003 and the z is mounted on a Windows Server 2008. I want to create a Scheduled Task on the 08 server that copies this folder nightly into new directory named with the date "YearDayMonth".
I've looked into FastCopy and RichCopy but I don't see the ability to create this directory. Any example of hot to create this batch would be greatly appreciated.
Thanks
 
Joined
Apr 16, 2012
Thread starter #2
I've found and modified this PowerShell script as a solution for this but it's not copying the files that are in the source folder. It's only copying the folder itself.
Code:
$date=get-date format d
$date=$date -replace "/", "-"
$destpath = "$date"
$storage=new-item -path \\192.168.3.212\c$\fileshares -name $destpath -type directory
copy-item -path D:\bk -destination $storage
 
Last edited by a moderator: