2

Let's say I store some really important stuff in C:\User\Rahul\Desktop\IMP.

Is it possible to make windows automatically mirror the contents of that folder to C:\Users\Rahul\OneDrive\IMP constantly or at the end of every hour/week/minute?

undo
  • 6,129

1 Answers1

3

Mirror a folder automatically?

Let's cay I store some really important stuff in C:\User\Rahul\Desktop\IMP.

Is it possible to make windows automatically mirror the contents of that folder to C:\Users\Rahul\OneDrive\IMP constantly or at the end of every hour/week/minute?

Robocopy Script Example

(Look over options to ensure all is set for your needs)

SET SRC="C:\User\Rahul\Desktop\IMP"
SET DEST="C:\Users\Rahul\OneDrive\IMP"
SET FName=*.*
SET LOG=C:\Path\Log.txt
::   If you do not want a log file, remove the "/LOG+:%LOG%" below
SET OPT=/PURGE /S /NP /R:5 /LOG+:%Log% /TS /FP
SET CMD=robocopy %SRC% %FName% %DEST% %OPT%
%CMD%

Scheduling for Unattended Automation

Refer to my answer Scheduled Tasks for the options, gotchas, etc. you'll want to select when scheduling a batch script with Task Scheduler to run as expected; screen shots and all are provided.


Further Resources and Reading