Google-chrome – Import html favorites file into chrome from command line

bookmarkscommand linegoogle-chromeinternet-explorer-11

I have a list of Favorites from Internet Explorer 11 (Windows 7 SP1 32-bit) which I saved into an .HTML file.

I am trying to import the favorites into Chrome from a command line or some sort of automated way.

The reason is I use SCCM to create a system image and would like the favorites to be already set in Chrome without user intervention.

Is this possible?

Best Answer

Import your bookmarks to chrome. Then close chrome and backup your bookmark file. Here is a section of script that I use as a boot script to backup and restore bookmarks in a VDI environment.

This will be in both the following shutdown and startup scripts:

SET CHROMEBASE=%LOCALAPPDATA%\Google\Chrome\User Data\Default
SET CHROMEBACKUPDIR=Z:\ChromeBookmarks

This will be in a shutdown script:

:CHROMEBACKUP
IF EXIST "%CHROMEBASE%" ROBOCOPY "%CHROMEBASE%" "%CHROMEBACKUPDIR%" Bookmarks /XO /R:5 /ETA
GOTO :EOF

This will be in a startup script:

:CHROMERESTORE
TASKLIST /FI "IMAGENAME eq chrome.exe" | findstr "chrome.exe" > nul
IF %ERRORLEVEL% == 0 (
CALL :CHROMEOPEN
GOTO :CHROMERESTORE
)
IF EXIST "%CHROMEBACKUPDIR%" ROBOCOPY "%CHROMEBACKUPDIR%" "%CHROMEBASE%" Bookmarks /R:5 /ETA
GOTO :EOF

:CHROMEOPEN
ECHO When you get a chance close Google Chrome.
ECHO.
ECHO If it appears to be closed but you still get this error please use task manager to end tasks with the name of "chrome.exe".
ECHO.
ECHO I will automatically try again once you continue.
ECHO Press any key to continue.
CHOICE /N /C Y /D Y /T 2 > NUL
PAUSE >NUL
GOTO :EOF
Related Question