2

I have adapted a script to find "bookmarks." in the chrome profiles. but I have about 4 profiles.

Profile 1, Profile 2, Profile 3, Profile 4.

is there a way to create the found "bookmarks." to go into the destination copied profile location? so it matches the source?... currently it trys to overwrite the destination.

My script is as follows:

cd\Users\David\AppData\Local\Google\Chrome\User Data\

for /r %%a in (bookmarks.*) do xcopy "%%a" c:\Users\David\Downloads\testme /s /i

Dave
  • 23

2 Answers2

2

Also, take a look at the /MIR parameter of RoboCopy. It mirrors the directory structure exactly in the destination.

Example:

robocopy "c:\users\johndoe\desktop\test" "d:\test" Bookmarks.* /mir

This copies files that're named Bookmarks (with any extension) recursively, maintaining the same directory structure in the destination. /MIR parameter takes care of that.

w32sh
  • 11,889
  • Ohhhhh!! I just couldn't work out the /MIR command with only spefic files.... you have pointed me in the correct direction – Dave Jul 14 '16 at 08:37
1

Script to do a mirror copy

is there a way to create the found "bookmarks." to go into the destination copied profile location? so it matches the source?

Sure you can do this with Robocopy assuming you're using a modern version of Windows.

Look over options to ensure all is set for your needs. Ensure the SRC variable is set to the source location where to start the search to find bookmarks. to copy over, and that the DEST variable is the destination location where those files are to be copied to if they exist on the source location but not (or different) than what's on the destination location.

SET SRC="C:\path\source"
SET DEST="C:\path\destination"
SET FName=bookmarks.*
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%

Further Resources and Reading