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

22 Jun 2012   #80
Hugh Jasse

Windows 7 32 and 64 bit
 
 

I would suspect the user would be logged off. Since the scheduled task would run at night, we could instruct them to log off each weeknight when they leave for the day.


My System SpecsSystem Spec
.
25 Jun 2012   #81
Hugh Jasse

Windows 7 32 and 64 bit
 
 
batch file creation

Hi Golden

Haven't heard anything from you since my last question. The boss wants me to figure this out by tomorrow ( 6-26-2012 ). He also said he is more concerned with backing up the profile than restoring it. Could you possible show me how to create a batch file to automatically back up the currently logged in user profile to either an external drive, or a network location?
I am going to experiment with some of the examples given here.
My System SpecsSystem Spec
25 Jun 2012   #82
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Hi Hugh,

I have made some queries on your behalf, but haven't heard anything back yet. Try this:

Code:
 
robocopy C:\Users\{username} Z:\UserProfiles /COPYALL /MIR /E
Regards,
Golden
My System SpecsSystem Spec
26 Jun 2012   #83
babysister

win7 unl 32bit
 
 

good tutorial
My System SpecsSystem Spec
.

26 Jun 2012   #84
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Thanks babysister - I hope you find it useful
My System SpecsSystem Spec
26 Jun 2012   #85
Hugh Jasse

Windows 7 32 and 64 bit
 
 

Hi Golden,

Thanks for the reply. I have been experimenting with this. It will copy the NTUSER.DAT file if I run it from another administrator account. I havent tried it, but I would hope if it is set to run as a scheduled task, using domain admin creds, and the user logs off, it would be able to copy the NTUSER.DAT file. YThe boss tells me it is imperative that we do back that file up.

robocopy "C:\Users\username" "G:\username" /e /MIR /R:0 /ZB /COPYALL /XD "Temporary Internet Files" /W:0 /NP /FFT /log:"G:\TH\username_LOG.txt" /NDL

I also added the /MT:16 switch and robocopy errored out saying the /MT switch was an invalid parameter
My System SpecsSystem Spec
30 Jun 2012   #86
azion

Windows 7 Home Premium 32 bit
 
 
Robocopy - Create Backup Script

Thanks for a very helpful article Golden.

Just a query about the /MIR option. You write that you include this to "check the files in the destination, and only copy newer files". I've only just started to research Robocopy but I have read that the default action of this programme is only to replace files in the destination folder which have a different time stamp or a different size to the source file. This implies that updated source files will always overwrite the destination file and unchanged files will not.

If this is so then perhaps one doesn't need to use the /MIR option. Perhaps there is another reason. I realise that omiting it will mean that files which have been deleted from the source folder will remain in the destination folder.
My System SpecsSystem Spec
30 Jun 2012   #87
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Hi Azion,

Welcome to SevenForums and thanks for the comment,

Perhaps you are correct. I re-read the robocopy entry in Wikipedia, and it seems to imply the /MIR switch is more useful for removing files from the destination, if they are no longer present at the source:

Quote:
Mirror A to B, destroying any files in B that are not present in A (/MIR)
https://en.wikipedia.org/wiki/Robocopy

The technet article simply states that the directory structures are mirrored.

Regards,
Golden
My System SpecsSystem Spec
10 Jul 2012   #88
Brds7t7

Windows 7 Pro 64-Bit, Windows 7 Ultimate 64-Bit, Windows 8.1 Pro 64-Bit
 
 

I just want to say a massive Thanks to Golden for creating this thread. Never even used Robocopy before this and now I'm using it everyday with different switches for different scenarios! Love it!
My System SpecsSystem Spec
10 Jul 2012   #89
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

No worries Burdus - glad you are finding it useful
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 19:23.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App