Windows 7 xcopy to terserver

using following bat file to back up windows 7 data to teraserver
net use a: \\harry\fred password > c:\log\errorlog
set /p response=<c:\log\errorlog
if not "%response:~22,12%"=="successfully" goto end
time /T > c:\log\fred.log
xcopy c:\fred a: /D /E /C /F /R /K /Y /Z > c:\log\fred.log
time /T > c:\log\fred.log
net use a: /delete > c:\log\errorlog
set /p response=<c:\log\errorlog
if not "%response:~15,12%"=="successfully" goto end

copies files ok but copies all files not just new ones
1 answer Last reply
More about windows xcopy terserver
  1. Hi, use VBS Scripts. the following copy it and save it as a .vbs file

    Dim sOriginFolder, sDestinationFolder, sFile, oFSO
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    sOriginFolder = "\\Server\Data"
    sDestinationFolder = "C:\Backup"
    For Each sFile In oFSO.GetFolder(sOriginFolder).Files
    If Not oFSO.FileExists(sDestinationFolder & "\" & oFSO.GetFileName(sFile)) Then
    oFSO.GetFile(sFile).Copy sDestinationFolder & "\" & oFSO.GetFileName(sFile),True
    WScript.Echo "Copying : " & Chr(34) & oFSO.GetFileName(sFile) & Chr(34) & " to " & sDestinationFolder
    End If

    the "sOriginFolder = "\\Server\Data"" is the files you want to backup and
    "sDestinationFolder = "C:\Backup"" is where it must be backed up.

    hope it helps
Ask a new question

Read More

Windows 7