Created
June 7, 2021 15:04
-
-
Save bentodaniel/f11442586cefc68a0bb4fc8f81679f82 to your computer and use it in GitHub Desktop.
Script to quickly set up or get all bookmarks from google chrome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: This script gets or sets the bookmarks from browser | |
@echo off | |
cls | |
set $bookmark_location="%LOCALAPPDATA%\Google\Chrome\User Data\Default\Bookmarks" | |
set mypath=%cd% | |
:choice | |
set /P c=Get/Set browser bookmarks [[92mY[0m/[91mN[0m]? | |
if /I "%c%" EQU "Y" goto :browser_info | |
if /I "%c%" EQU "N" goto :exit | |
:browser_info | |
echo. | |
echo [91mWarning[0m this script uses by default Google Chrome | |
echo. | |
echo You have 10 seconds to answer. Default is No. | |
choice /c YN /n /t 10 /d N /m "Do you want to change the browser [Y/N]? " | |
if errorlevel 2 goto :start_execution | |
if errorlevel 1 goto :change_browser | |
:: Allows the user to change the browser used | |
:change_browser | |
echo. | |
set /p $bookmark_location=Insert location of browser bookmarks: | |
:: Starts execution | |
:start_execution | |
echo. | |
echo You have 10 seconds to answer. Default is Set. | |
choice /c SG /n /t 10 /d S /m "Do you want to [S]et or [G]et bookmarks [S/G]? " | |
if errorlevel 2 goto :get_bookmarks | |
if errorlevel 1 goto :set_bookmarks | |
:: Sets the bookmarks into the browser | |
:set_bookmarks | |
echo. | |
choice /c YN /n /t 10 /d N /m "Do you want to change file location? Default is %mypath%\Bookmarks [Y/N]? " | |
if errorlevel 2 goto :set_bookmarks_action | |
if errorlevel 1 goto :change_path | |
:change_path | |
echo. | |
set /p mypath=Enter the bookmarks file path: | |
:: Copies the bookmarks file to the browser dir | |
:set_bookmarks_action | |
echo. | |
echo [92mSetting bookmarks...[0m | |
echo. | |
copy %mypath%\Bookmarks %$bookmark_location% | |
echo Bookmarks have been saved to %$bookmark_location% | |
goto :exit | |
:: Gets the bookmarks from browser | |
:get_bookmarks | |
echo. | |
echo [92mGetting bookmarks...[0m | |
echo. | |
copy %$bookmark_location% Bookmarks | |
set mypath=%cd% | |
echo Bookmarks have been saved to %mypath%\Bookmarks | |
goto :exit | |
:: Stops execution of the script | |
:exit | |
echo. | |
echo [91mExiting...[0m | |
goto :eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment