This is not my forte at all, and I'm wondering if anyone has a basic script handy for Windows 2003 to copy an entire folder (inc subfolders & files)to another server each night.
So far my efforts have had a few issues - mainly that I can't delete the entire folder & then copy it back. This seemed the simplest solution but I can't get it to work.
Any sample scripts appreciated.
This conversation is currently closed to new comments.
I do this everyday - I use the XCOPY command in a MS-DOS batch file to copy changed and newly created files and folders to another computer. I schedule the task to run with administrative credentials and make sure that the targets on both computers are fully accessible by the administrative account.
I use a batch file called update.bat. This copies files and folders and retains the archive bit, it also copies newly created folders to the target. The first line creates an entry in the event log and confirms that the file has started, and last line confirms that it has finished.
eventcreate /t information /id 998 /l application /d "Update.bat has started" start /wait /b xcopy \\servername\sharename\*.* \\servername\sharename /c /d /s /e /k /y /z /i eventcreate /t information /id 998 /l application /d "Update.bat has finished"
One word of warning: If you will be copying a large number of files and folders you will need to use XCOPY to target individual folders. Otherwise you will run out of memory - as I discovered when I tried to copy changed files from a source that was 40GB...
So, instead of just one blanket copy command you would have the following:
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
DOS script to copy folder
This is not my forte at all, and I'm wondering if anyone has a basic script handy for Windows 2003 to copy an entire folder (inc subfolders & files)to another server each night.
So far my efforts have had a few issues - mainly that I can't delete the entire folder & then copy it back. This seemed the simplest solution but I can't get it to work.
Any sample scripts appreciated.