Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: ROBOCOPY - Create Backup Script

26 Mar 2012   #50
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Great stuff Burdus - there is real wealth of knowledge accumulated here.


My System SpecsSystem Spec
.
26 Mar 2012   #51
JDobbsy1987

Windows 8.1 Pro x64
 
 

Quote   Quote: Originally Posted by Golden View Post
Great stuff Burdus - there is real wealth of knowledge accumulated here.
Your not wrong there
My System SpecsSystem Spec
27 Mar 2012   #52
BSeanD

Windows 7
 
 

If only you had written this article a year and a half ago. :-P

Great work Golden.
My System SpecsSystem Spec
27 Mar 2012   #53
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Thanks BSeanD
My System SpecsSystem Spec
.

29 Mar 2012   #54
AlkiDweller

Server 2008
 
 

For years I've used an xcopy replacement utility called xxcopy and it functions a lot like Robocopy. It's /clone switch is a lot like Robocopy's /MIR switch.

One thing it does that, as far as I can tell, Robocopy can't, is create destination folder names based on the date. For instance, tonight's incremental backup would be in a folder called 2012-03-29.

With Robocopy in a batch file I've been deleting folders named for the weekday and having them recreated in the destination when Robocopy runs. As in...

:mon
rmdir x:\backup\Daily\1-Monday\ /S /Q
robocopy d:\shared x:\backup\Daily\1-Monday [long list of switches]

The batch file starts by testing for the day of the week and then skips to the part of the batch file for that day (as in :mon). I end up with 7 backup folders only containing files that had the archive bit set for that given day.

But I only get seven days, unless I can figure out how to get the task manager to run two batch files on alternating weeks.

Any ideas on how to get incremental backups that go back further than one week?
My System SpecsSystem Spec
25 Apr 2012   #55
arpitbpatel

Windows 7 32-bit and 64 bit
 
 
Need Help with Robocopy script

Hi Golden,

I Need your help with robocopy script.

I have extenal IP hard drive 2 TB each and 4 of them. I want to write a script so It will check if Hardrive is live and copy the data over there. When its copy new data I want to create a new folder with current date like " Backup 12-04-25"

So far this is what i can do in my test.

robocopy "C:\SQL" C:\Backup\ /copyAT /e /z /v /tee /log:c:backup_log.txt
pause

Can you help?

Thanks,
Arpit


Quote   Quote: Originally Posted by Golden View Post
Hi,

OK. You need to let me know what you want backing up, and to where.

The easiest way is to show me some screen capture images of:

1. Your Disk Management with your USB external drive plugged in (so I can see the arrangement of your disks)
2. Windows Explorer showing me the paths and files you want to backup.

See here for help on getting me the information:

Screenshots and Files - Upload and Post in Seven Forums

Regards,
Golden
My System SpecsSystem Spec
28 Apr 2012   #56
Haus6565

7 64bit
 
 

Hi All,

I have written a robocopy script to migrate the company I work for from XP to 7 64bit and to do transfers from 7 to 7 for future data back up and restore after reimaging machines.

Like most scripts you can only look at it so long before it starts to run together. Would it be ok to post it here to get another set of eyes on it? It works really well but I just want to make sure I have not left something out or have to much in terms of the switches.
My System SpecsSystem Spec
28 Apr 2012   #57
Brink

64-bit Windows 10 Pro
 
 

Hello Haus, and welcome to Seven Forums.

Sure, it'll be fine to post here if you like.
My System SpecsSystem Spec
28 Apr 2012   #58
Haus6565

7 64bit
 
 

Great!

Let me explain a bit what I have it doing first then I'll put it in the next post.
I made it to be an interactive "program" for lack of a better term.
I have distributed it out to my 16 co-workers in 8 different sites around the country as we have have the task of moving 5000 users to Windows 7.

It is launched from a folder containing the .cmd file and robocopy.exe (for portability).
The script opens a command prompt window where you make a task selection. 1-7, 0 to exit.
The options1-2 are direct machine to machine data transfers over the LAN. XP to 7 & 7 to 7.
The options 3-4 are for hard drive pulls from the old machine using a powered USB drive adaptor for data transfer to the new machine.
The options 5-6 are to copy the data to an extrenal USB storage device.
Option 7 restores it from the USB drive.

In it you will see that I have per-converted all XP folders/locations to Windows 7 folder/locations for easier restore.

So to launch it, you just double click the cmd file in a folder with the robocopy.exe in it (for XP).
You then get a prompt asking for UserID, Old computer name, drive letter, depending on the selection.
After that you'll get the idea what happens.
Script in the next post.

Code:
 
@ECHO OFF
c:\windows\system32\cmd.exe /c mode con cols=100 lines=45
Color 3F
CLS
:MENU
ECHO.________________________________________________________________________________
ECHO.
ECHO. Windows 7 Migration Tool
ECHO.
ECHO. Note: All data copies from Windows XP are translated into the Windows 7
ECHO. directory structure. ("Documents and Settings" to "Users", etc.)
ECHO.
ECHO. !!!Remember to turn off UAC and set power option to never sleep!!!
ECHO.________________________________________________________________________________
ECHO.
ECHO ............................................................
ECHO PRESS 1 2 3 4 5 6 7 to select your task, or 0 to EXIT.
ECHO ............................................................
ECHO.
ECHO 1 - Network Data Transfer: Old XP (remote) to new Windows 7 (local)
ECHO.
ECHO 2 - Network Data Transfer: Old 7 (remote) to new Windows 7 (local)
ECHO.
ECHO 3 - Local USB Drive Adaptor XP drive to 7 (C:) (local)
ECHO.
ECHO 4 - Local USB Drive Adaptor 7 drive to 7 (C:) (local)
ECHO.
ECHO 5 - Local USB Data Backup: Local XP (C:) to local USB drive
ECHO.
ECHO 6 - Local USB Data Backup: Local 7 (C:) to local USB drive
ECHO.
ECHO 7 - USB Drive Restore: Restore local USB drive to new Windows 7 (local)
ECHO.
ECHO 0 - EXIT
ECHO.
SET /P M=Type 1, 2, 3, 4, 5, 6, 7, or 0, then press ENTER: 
IF %M%==1 GOTO XPto7
IF %M%==2 GOTO 7to7
IF %M%==3 GOTO XPUSBtoC
IF %M%==4 GOTO 7USBtoC
IF %M%==5 GOTO XPCtoE
IF %M%==6 GOTO 7CtoE
IF %M%==7 GOTO ResEtoC7
IF %M%==0 GOTO Quit
rem ------------------------------------------------------------------------
:XPto7
ECHO.
ECHO.[-----Network Data Transfer: Old XP to New 7-----]
ECHO.
NET USE Z: /Delete > NUL
ECHO Enter Users OracleID:
Set /p USER=
REM OracleID is equivelent to AD User ID
ECHO.
ECHO Network Share: Enter the user's old XP Computer Name:
Set /P OldXP=
NET USE Z: \\%OldXP%\C$
REM 
robocopy Z:\ C:\ /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "autoexec.bat" "boot.ini" "cmldr" "config.sys" "Desktop.ini" "hiberfil.sys" "IO.SYS" "NTDETECT.COM" "ntldr" "MSDOS.SYS" "pagefile.sys" "Thumbs.db" /XD ".Xilinx" "Applications" "Cadence" "CadenceHome" "cmdcons" "Config.msi" "Dell" "Documents and Settings" "Drivers" "i386" "Intel" "MSOCache" "Notes" "Program Files" "RECYCLER" "$Recycle.Bin" "SP3" "System Volume Information" "swshare" "swtools" "valueadd" "WINDOWS" "Xilinx" /L /LOG+:Step1.txt 
robocopy Z:\Notes "C:\Program Files (x86)\Lotus\Notes" notes.ini /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy Z:\Notes\Data "C:\Program Files (x86)\Lotus\Notes\Data" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\Desktop" C:\Users\%USER%\Desktop /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\Favorites" C:\Users\%USER%\Favorites /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\My Documents" C:\Users\%USER%\Documents /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /XD "Downloads" "Favorites" "Pictures" "My Pictures" "Music" "My Music" "Shapes" "My Shapes" "Videos" "My Videos" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\My Documents\Favorites" C:\Users\%USER%\Favorites /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\My Documents\My Music" C:\Users\%USER%\Music /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\My Documents\Downloads" C:\Users\%USER%\Downloads /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\My Documents\My Pictures" C:\Users\%USER%\Pictures /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\My Documents\My Videos" C:\Users\%USER%\Videos /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\My Documents\My Shapes" "C:\Users\%USER%\Documents\My Shapes" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\Local Settings\Application Data\Microsoft\Outlook" "C:\Users\%USER%\Documents\Outlook Files" *.pst /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\Application Data\Microsoft\Signatures" C:\Users\%USER%\AppData\Roaming\Microsoft\Signatures /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\Application Data\Microsoft\Stationery" "C:\Program Files (x86)\Common Files\Microsoft Shared\Stationery" /E /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\Application Data\Microsoft\Templates" C:\Users\%USER%\AppData\Roaming\Microsoft\Templates /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\Application Data\Microsoft\Proof" C:\Users\%USER%\AppData\Roaming\Microsoft\UProof /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\Application Data\Microsoft\UProof" C:\Users\%USER%\AppData\Roaming\Microsoft\UProof /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\Application Data\Microsoft\Outlook" C:\Users\%USER%\AppData\Roaming\Microsoft\Outlook *.nk2 /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Documents and Settings\%USER%\Local Settings\Application Data\Microsoft\Outlook" C:\Users\%user%\AppData\Local\Microsoft\Outlook *.pab *.oab /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
NET USE Z: /Delete > NUL
GOTO END
rem ------------------------------------------------------------------------
:7to7
ECHO.
ECHO.[------Network Data Transfer: Old 7 to New 7------]
ECHO.
NET USE Z: /Delete > NUL
ECHO Enter Users OracleID:
Set /p USER=
REM OracleID is equivelent to AD User ID
ECHO.
ECHO Network Share: Enter the user's old 7 Computer Name:
Set /P Old7=
NET USE Z: \\%Old7%\C$
REM 
robocopy Z:\ C:\ /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /XF "*.log" "Thumbs.db" "Desktop.ini" ".rnd" "bootmgr" "hiberfil.sys" "pagefile.sys" /XD ".Xilinx" "Applications" "Boot" "Cadence" "CadenceHome" "Config.msi" "de8b2a33417deb7cb2a115cae06cd1" "Dell" "Documents and Settings" "Drivers" "Intel" "Kontiki" "MSOCache" "PerfLogs" "Program Files" "Program Files (x86)" "ProgramData" "Recovery" "$Recycle.Bin" "RECYCLER" "System Volume Information" "USERS" "WINDOWS" "Xilinx" /L /LOG+:Step1.txt 
robocopy "Z:\Program Files (x86)\Lotus\Notes" "C:\Program Files (x86)\Lotus\Notes" notes.ini /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Program Files (x86)\Lotus\Notes\Data" "C:\Program Files (x86)\Lotus\Notes\Data" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "Z:\Program Files (x86)\Common Files\Microsoft Shared\Stationery" "C:\Program Files (x86)\Common Files\Microsoft Shared\Stationery" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy Z:\Users\%USER% C:\Users\%USER% /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "Album*.jpg" "*.log" *.policy" "Thumbs.db" "Desktop.ini" "ntuser*.*" /XD "AppData" "Application Data" "Local Settings" "Office Genuine Advantage" /L /LOG+:Step1.txt 
robocopy Z:\Users\%USER%\Documents C:\Users\%USER%\Documents /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "Album*.jpg" "*.log" *.policy" "Thumbs.db" "Desktop.ini" "ntuser*.*" /XD "AppData" "Application Data" "Local Settings" "Office Genuine Advantage" /L /LOG+:Step1.txt 
robocopy Z:\Users\%USER%\AppData\Roaming\Microsoft\Signatures C:\Users\%USER%\AppData\Roaming\Microsoft\Signatures /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy Z:\Users\%USER%\AppData\Roaming\Microsoft\Templates C:\Users\%USER%\AppData\Roaming\Microsoft\Templates /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy Z:\Users\%USER%\AppData\Roaming\Microsoft\UProof C:\Users\%USER%\AppData\Roaming\Microsoft\UProof /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy Z:\Users\%USER%\AppData\Roaming\Microsoft\Outlook C:\Users\%USER%\AppData\Roaming\Microsoft\Outlook *.nk2 /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy Z:\Users\%user%\AppData\Local\Microsoft\Outlook C:\Users\%user%\AppData\Local\Microsoft\Outlook *.pab *.oab /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
NET USE Z: /Delete > NUL
GOTO END
rem ------------------------------------------------------------------------
:XPUSBtoC
ECHO.
ECHO.[----------Pulled Drive on USB Drive Adapter XP Data Transfer to 7-----------]
ECHO.
ECHO Enter Users OracleID:
Set /p USER=
REM OracleID is equivelent to AD User ID
ECHO.
ECHO Enter the USB drive letter: (example) X:
Set /p USBDrive=
REM
robocopy %USBDrive% C:\ /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "autoexec.bat" "boot.ini" "cmldr" "config.sys" "Desktop.ini" "hiberfil.sys" "IO.SYS" "NTDETECT.COM" "ntldr" "MSDOS.SYS" "pagefile.sys" "Thumbs.db" /XD ".Xilinx" "Applications" "Cadence" "CadenceHome" "cmdcons" "Config.msi" "Dell" "Documents and Settings" "Drivers" "i386" "Intel" "MSOCache" "Notes" "Program Files" "RECYCLER" "$Recycle.Bin" "SP3" "System Volume Information" "swshare" "swtools" "valueadd" "WINDOWS" "Xilinx" /L /LOG+:Step1.txt 
robocopy %USBDrive%\Note "C:\Program Files (x86)\Lotus\Notes" notes.ini /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy %USBDrive%\Notes\Data "C:\Program Files (x86)\Lotus\Notes\Data" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\Desktop" C:\Users\%USER%\Desktop /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\Favorites" C:\Users\%USER%\Favorites /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\My Documents" C:\Users\%USER%\Documents /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /XD "Downloads" "Favorites" "Pictures" "My Pictures" "Music" "My Music" "Shapes" "My Shapes" "Videos" "My Videos" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\My Documents\Favorites" C:\Users\%USER%\Favorites /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt
robocopy "%USBDrive%\Documents and Settings\%USER%\My Documents\My Music" C:\Users\%USER%\Music /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\My Documents\Downloads" C:\Users\%USER%\Downloads /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\My Documents\My Pictures" C:\Users\%USER%\Pictures /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\My Documents\My Videos" C:\Users\%USER%\Videos /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\My Documents\My Shapes" "C:\Users\%USER%\Documents\My Shapes" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\Local Settings\Application Data\Microsoft\Outlook" "C:\Users\%USER%\Documents\Outlook Files" *.pst /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\Application Data\Microsoft\Signatures" C:\Users\%USER%\AppData\Roaming\Microsoft\Signatures /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\Application Data\Microsoft\Stationery" "C:\Program Files (x86)\Common Files\Microsoft Shared\Stationery" /E /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\Application Data\Microsoft\Templates" C:\Users\%USER%\AppData\Roaming\Microsoft\Templates /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\Application Data\Microsoft\Proof" C:\Users\%USER%\AppData\Roaming\Microsoft\UProof /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\Application Data\Microsoft\UProof" C:\Users\%USER%\AppData\Roaming\Microsoft\UProof /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\Application Data\Microsoft\Outlook" C:\Users\%USER%\AppData\Roaming\Microsoft\Outlook *.nk2 /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Documents and Settings\%USER%\Local Settings\Application Data\Microsoft\Outlook" C:\Users\%user%\AppData\Local\Microsoft\Outlook *.pab *.oab /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
GOTO END
rem ------------------------------------------------------------------------
:7USBtoC
ECHO.
ECHO.[----------Pulled Drive on USB Drive Adapter 7 Data Transfer to 7-----------]
ECHO.
ECHO Enter Users OracleID:
Set /p USER=
REM OracleID is equivelent to AD User ID
ECHO.
ECHO Enter the USB drive letter: (example) X:
Set /p USBDrive=
REM
robocopy %USBDrive% C:\ /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /XF "*.log" "Thumbs.db" "Desktop.ini" ".rnd" "bootmgr" "hiberfil.sys" "pagefile.sys" /XD ".Xilinx" "Applications" "Boot" "Cadence" "CadenceHome" "Config.msi" "de8b2a33417deb7cb2a115cae06cd1" "Dell" "Documents and Settings" "Drivers" "Intel" "Kontiki" "MSOCache" "PerfLogs" "Program Files" "Program Files (x86)" "ProgramData" "Recovery" "$Recycle.Bin" "RECYCLER" "System Volume Information" "USERS" "WINDOWS" "Xilinx" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Program Files (x86)\Lotus\Notes" "C:\Program Files (x86)\Lotus\Notes" notes.ini /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Program Files (x86)\Lotus\Notes\Data" "C:\Program Files (x86)\Lotus\Notes\Data" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "%USBDrive%\Program Files (x86)\Common Files\Microsoft Shared\Stationery" "C:\Program Files (x86)\Common Files\Microsoft Shared\Stationery" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy %USBDrive%\Users\%USER% C:\Users\%USER% /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "Album*.jpg" "*.log" *.policy" "Thumbs.db" "Desktop.ini" "ntuser*.*" /XD "AppData" "Application Data" "Local Settings" "Office Genuine Advantage" /L /LOG+:Step1.txt 
robocopy %USBDrive%\Users\%USER%\Documents C:\Users\%USER%\Documents /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "Album*.jpg" "*.log" *.policy" "Thumbs.db" "Desktop.ini" "ntuser*.*" /XD "AppData" "Application Data" "Local Settings" "Office Genuine Advantage" /L /LOG+:Step1.txt 
robocopy %USBDrive%\Users\%USER%\AppData\Roaming\Microsoft\Signatures C:\Users\%USER%\AppData\Roaming\Microsoft\Signatures /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy %USBDrive%\Users\%USER%\AppData\Roaming\Microsoft\Templates C:\Users\%USER%\AppData\Roaming\Microsoft\Templates /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy %USBDrive%\Users\%USER%\AppData\Roaming\Microsoft\UProof C:\Users\%USER%\AppData\Roaming\Microsoft\UProof /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy %USBDrive%\Users\%USER%\AppData\Roaming\Microsoft\Outlook C:\Users\%USER%\AppData\Roaming\Microsoft\Outlook *.nk2 /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy %USBDrive%\Users\%user%\AppData\Local\Microsoft\Outlook C:\Users\%user%\AppData\Local\Microsoft\Outlook *.pab *.oab /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
GOTO END
rem ------------------------------------------------------------------------
:XPCtoE
ECHO.
ECHO.[-----------Old XP Machine Drive to USB Drive Backup-----------]
ECHO.
ECHO Enter Users OracleID:
Set /p USER=
REM OracleID is equivelent to AD User ID
ECHO.
ECHO Enter the USB drive letter: (example) X:
Set /p USBDrive=
MD %USBDrive%\%USER%
REM
robocopy C:\ %USBDrive%\%USER%\ /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "autoexec.bat" "boot.ini" "cmldr" "config.sys" "Desktop.ini" "hiberfil.sys" "IO.SYS" "NTDETECT.COM" "ntldr" "MSDOS.SYS" "pagefile.sys" "Thumbs.db" /XD ".Xilinx" "Applications" "Cadence" "CadenceHome" "cmdcons" "Config.msi" "Dell" "Documents and Settings" "Drivers" "i386" "Intel" "MSOCache" "Notes" "Program Files" "RECYCLER" "$Recycle.Bin" "SP3" "System Volume Information" "swshare" "swtools" "valueadd" "WINDOWS" "Xilinx" /L /LOG+:Step1.txt 
robocopy C:\Notes "%USBDrive%\%USER%\Program Files (x86)\Lotus\Notes" notes.ini /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy C:\Notes\Data "%USBDrive%\%USER%\Program Files (x86)\Lotus\Notes\Data" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\Desktop" %USBDrive%\%USER%\Users\%USER%\Desktop /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\Favorites" %USBDrive%\%USER%\Users\%USER%\Favorites /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\My Documents" %USBDrive%\%USER%\Users\%USER%\Documents /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /XD "Downloads" "Favorites" "Pictures" "My Pictures" "Music" "My Music" "Shapes" "My Shapes" "Videos" "My Videos" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\My Documents\Favorites" %USBDrive%\%USER%\Users\%USER%\Favorites /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\My Documents\My Music" %USBDrive%\%USER%\Users\%USER%\Music /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\My Documents\My Pictures" %USBDrive%\%USER%\Users\%USER%\Pictures /E /COPYALL /B /SEC /MIR /V /NP /R:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /W:2 /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\My Documents\My Videos" %USBDrive%\%USER%\Users\%USER%\Videos /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\My Documents\My Shapes" "%USBDrive%\%USER%\Users\%USER%\Documents\My Shapes" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\My Documents\Downloads" %USBDrive%\%USER%\Users\%USER%\Downloads /E /COPY:DATSO /V /NP /R:2 /W:2 /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\Local Settings\Application Data\Microsoft\Outlook" "%USBDrive%\%USER%\Users\%USER%\Documents\Outlook Files" *.pst /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\Application Data\Microsoft\Signatures" %USBDrive%\%USER%\Users\%USER%\AppData\Roaming\Microsoft\Signatures /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\Application Data\Microsoft\Stationery" "%USBDrive%\%USER%\Program Files (x86)\Common Files\Microsoft Shared\Stationery" /E /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\Application Data\Microsoft\Templates" %USBDrive%\%USER%\Users\%USER%\AppData\Roaming\Microsoft\Templates /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\Application Data\Microsoft\Proof" %USBDrive%\%USER%\Users\%USER%\AppData\Roaming\Microsoft\UProof /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\Application Data\Microsoft\UProof" %USBDrive%\%USER%\Users\%USER%\AppData\Roaming\Microsoft\UProof /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\Application Data\Microsoft\Outlook" %USBDrive%\%USER%\Users\%USER%\AppData\Roaming\Microsoft\Outlook *.nk2 /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Documents and Settings\%USER%\Local Settings\Application Data\Microsoft\Outlook" %USBDrive%\%USER%\Users\%USER%\AppData\Local\Microsoft\Outlook *.pab *.oab /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
attrib -h -s %USBDrive%\%USER% 
GOTO END
rem ------------------------------------------------------------------------
:7CtoE
ECHO.
ECHO.[------------Old 7 Machine Drive to USB Drive Backup------------]
ECHO.
ECHO Enter Users OracleID:
Set /p USER=
REM OracleID is equivelent to AD User ID
ECHO.
ECHO Enter the USB drive letter: (example) X:
Set /p USBDrive=
MD %USBDrive%\%USER%
REM
robocopy C:\ %USBDrive%\%USER%\ /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" ".rnd" "bootmgr" "hiberfil.sys" "pagefile.sys" /XD ".Xilinx" "Applications" "Boot" "Cadence" "CadenceHome" "Config.msi" "de8b2a33417deb7cb2a115cae06cd1" "Dell" "Documents and Settings" "Drivers" "Intel" "Kontiki" "MSOCache" "PerfLogs" "Program Files" "Program Files (x86)" "ProgramData" "Recovery" "$Recycle.Bin" "RECYCLER" "System Volume Information" "USERS" "WINDOWS" "Xilinx" /L /LOG+:Step1.txt 
robocopy "C:\Program Files (x86)\Lotus\Notes" "%USBDrive%\%USER%\Program Files (x86)\Lotus\Notes" notes.ini /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Program Files (x86)\Lotus\Notes\Data" "%USBDrive%\%USER%\Program Files (x86)\Lotus\Notes\Data" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy "C:\Program Files (x86)\Common Files\Microsoft Shared\Stationery" "%USBDrive%\%USER%\Program Files (x86)\Common Files\Microsoft Shared\Stationery" /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy C:\Users\%USER% %USBDrive%\%USER%\Users\%USER% /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "Album*.jpg" "*.log" "*.policy" "Thumbs.db" "Desktop.ini" "ntuser*.*" /XD "AppData" "Application Data" "Local Settings" "Office Genuine Advantage" /L /LOG+:Step1.txt 
robocopy C:\Users\%USER%\Documents %USBDrive%\%USER%\Users\%USER%\Documents /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "Album*.jpg" "*.log" "*.policy" "Thumbs.db" "Desktop.ini" "ntuser*.*" /XD "AppData" "Application Data" "Local Settings" "Office Genuine Advantage" /L /LOG+:Step1.txt 
robocopy C:\Users\%USER%\AppData\Roaming\Microsoft\Signatures %USBDrive%\%USER%\Users\%USER%\AppData\Roaming\Microsoft\Signatures /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy C:\Users\%USER%\AppData\Roaming\Microsoft\Templates %USBDrive%\%USER%\Users\%USER%\AppData\Roaming\Microsoft\Templates /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy C:\Users\%USER%\AppData\Roaming\Microsoft\UProof %USBDrive%\%USER%\Users\%USER%\AppData\Roaming\Microsoft\UProof /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy C:\Users\%USER%\AppData\Roaming\Microsoft\Outlook %USBDrive%\%USER%\Users\%USER%\AppData\Roaming\Microsoft\Outlook *.nk2 /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
robocopy C:\Users\%USER%\AppData\Local\Microsoft\Outlook %USBDrive%\%USER%\Users\%USER%\AppData\Local\Microsoft\Outlook *.pab *.oab /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "Thumbs.db" "Desktop.ini" /L /LOG+:Step1.txt 
attrib -h -s %USBDrive%\%USER%
GOTO END
rem ------------------------------------------------------------------------
:ResEtoC7
ECHO.
ECHO.[------------Local USB Drive 7 Data Restore------------]
ECHO.
ECHO Enter Users OracleID:
Set /p USER=
REM OracleID is equivelent to AD User ID
ECHO.
ECHO Enter the USB drive letter: (example) X:
Set /p USBDrive=
ECHO.
robocopy %USBDrive%\%USER%\ C:\ /E /COPY:DATSO /V /NP /R:2 /W:2 /XA:SHO /XF "*.log" "$Recycle.Bin" "Thumbs.db" "Desktop.ini" /XD "$Recycle.Bin" /L /LOG+:Step1.txt 
GOTO END
:QUIT
ECHO.________________________________________________________________________________
ECHO.
ECHO.
ECHO. Terminated process, no action taken.
ECHO.
ECHO.
ECHO.________________________________________________________________________________
:END
ECHO.________________________________________________________________________________
ECHO.
ECHO. Completed! check the log files below for results...
ECHO.
ECHO.________________________________________________________________________________
ECHO.
dir step*.txt /b
ECHO.
Pause
As you can see we target specific data, makes for a better user experience.
You will also see a couple what appeears to be duplicate lines, this because you can not trust users to put things where they go, you know what I am talking about.
My System SpecsSystem Spec
02 May 2012   #59
Haus6565

7 64bit
 
 

Hi, just curious if anyone had a chance to give it a once over?
My System SpecsSystem Spec
Comment

 ROBOCOPY - Create Backup Script




Tutorial Tools Search this Tutorial
Search this Tutorial:

Advanced Search




Similar help and support threads
Windows 7 Tutorial Category
robocopy script is not working through Scheduler
Dear All, My batch file of robocopy is working fine. But when I tried to run it through task scheduler, none of the files transfer to the target location. @echo off echo +-----------------------------------------+ echo Database Export Utility for server ...
General Discussion
Robocopy Backup - ERROR 5 (0x00000005)
Hi, I'm wondering if anyone might be able to shed some light on why I am getting the following such errors when running a robocopy batch file (as administrator) which cause the backup script to stall (- albeit temporarily): I am using the following backup command: robocopy "%srcPath%\My...
Backup and Restore
How 2 create a script/BAT or something that changes my desktop image?
Okay so I just got this program called Transparent Screen Lock and you can run files when the program starts/locks and closes/unlocks. What I would like to do is create a script or something that changes my desktop background to an image when I click "lock" and another script to change the desktop...
Customization
Robocopy backup for personal folders
I have created a batch file for copying my Documents folder to an external hard drive: The log file shows that it is backing up C:\users\USERNAME\documents\My Music and C:\users\USERNAME\documents\My Pictures. That's fine, because I want those backed up anyway, but when I go to...
Backup and Restore
I Need Help To Create REG. Script With Admin. Priv. For Reg. Editor?
Hello. I have a technical question/issue I wish to ask. I hope someone can help me. I am looking help for someone to modify or rewrite for me a simple system registry script for my context menu that allows or forces to "run as administrator" privileges automatically when I click on the...
Customization
Anyone use robocopy to backup?
Evening all, Just curious to know if anyone uses the built in utility to backup software on your machine, im trying to backup my itunes folder to an external HD but having a few issues to get this to work properly! I also use sync toy for backing up but just really want to know what everyone...
Backup and Restore


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 14:08.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App