Skip to content

Instantly share code, notes, and snippets.

@cmbaughman
Forked from takikoo/README.md
Created March 20, 2019 23:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmbaughman/b746e9421ba117247af4452c8afd4efb to your computer and use it in GitHub Desktop.
Save cmbaughman/b746e9421ba117247af4452c8afd4efb to your computer and use it in GitHub Desktop.
Export bookmarks from Google Chrome with a batch script

Export chrome bookmarks

This is a script to export bookmarks from the web browser Google Chrome to a users home drive in a Windows environment with clients and domain controllers. Most of the script comes from this article

Instruction

  • Double-click on the bat-file.
  • Go the home drive on the users new computer.
  • Double-click on openChromeFolder.bat which will take you to the chrome directory on that machiene.
  • Copy the file Bookmarks to the newly opened window.
@ECHO off
title backup bookmarks on Winodows Vista/7
REM Recommended to run during user logoff in GPO (User Configuration\Policies\Windows Settings\scripts)
REM Path for the user's network file share
SET userprivatedrivepath=%HOMESHARE%\
REM Path for bookmark backup folder in user's network file share
SET userbookmarkspath=%userprivatedrivepath%\bookmark_backups
REM bookmark locations on user's computer
SET bookmark_chrome=%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default
REM bookmark backup path for the computer the user logged on to
SET userbookmarkspathcomputer=%userbookmarkspath%\%computername%
REM create folder to backup a computer's bookmarks to
IF NOT EXIST "%userbookmarkspath%" (
mkdir "%userbookmarkspath%"
)
REM backup bookmarks
ROBOCOPY "%bookmark_chrome%" "%userbookmarkspath%" Bookmarks /COPY:DAT /DCOPY:T /R:1 /W:30 /NP
REM save a script that opens the users chrome folder
echo explorer %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\ > %userbookmarkspath%\openChromeFolder.bat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment