How to backup My Documents on Windows 7 using batch script

Eric P
2017-10-13 01:21


The following script will create a folder on the D: drive named as today's date in numeric format, this is great if you need to schedule your PC to run Backups on a specific time of the day and provide you with several versions of My Document folder, you could send them to your Dropbox folder, Mega, etc.


-----> Save the script bellow as MYDocs.bat and run it.


set myDate=%date:~4,2%%date:~7,2%%date:~10%
mkdir h:\%myDate%
robocopy "c:\users\%username%"\Documents\ H:\%myDate% /e /R:1 /v /np /eta /w:2 /PURGE /XD TEMP >c:\users\%username%"\Desktop\MYDocs.txt

set myDate=%date:~4,2%%date:~7,2%%date:~10%

mkdir D:\%myDate%

robocopy "c:\users\%username%"\Documents\ D:\%myDate% /e /R:1 /v /np /eta /w:2 /PURGE /XD TEMP >c:\users\%username%"\Desktop\MYDocs.txt




Tags: backup my Documents, batch script, command line, create folders by date, create unique folder name, Documents, dropbox, Mega, my documents backup, Robocopy, script, synch, Win7 backup, Windows
Average rating: 0 (0 Votes)

You cannot comment on this entry