These are very old and will not work with modern versions of browsers. I wrote these quite a few years ago to automate exporting the history databases and files to be reviewed at a later time. I used robocopy since it was included in all windows machines at the time and allowed me to maintain metadata with very basic logging. Although they are obsolete I am positing them here for a reference.
@echo off
echo ************************************************
echo ** **
echo **Verify that Chrome is not open and running! **
echo ** **
echo ************************************************
echo(
echo(
::Parse hour minute and second to make accidental overwrite more difficult.
::These are used at the end of the folder created to store the data to create a more unique destination folder name.
set h=%TIME:~0,2%
set m=%TIME:~3,2%
set s=%TIME:~6,2%
::Ask to include the cache file.
:choice
set /P cache="Do you want to copy the cache file with the history? (Y)es/(N)o/(E)xit "
If /I "%cache%"=="y" (goto yes) else if /I "%cache%"=="n" (goto no) else if /I "%cache%"=="e" (goto end) else (echo Invalid Input & goto choice)
::Includes Cache file
::Creates a folder on the root of the drive the file is ran from to store data.
::The name is Chrome_HistoryCache_[USERNAME]_[TIME]
::It also creates a log file with the same name on the root of the drive the file is ran from.
:yes
robocopy "%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default" "%CD%\Chrome_HistoryCache_%USERNAME%_%h%%m%%s%" /E /TEE /LOG:"%CD%\Chrome_HistoryCache%USERNAME%_%h%%m%%s%.log"
echo(
echo(
echo Data written to: %CD%\Chrome_HistoryCache_%USERNAME%_%h%%m%%s%
echo Log written to: %CD%\Chrome_HistoryCache_%USERNAME%_%h%%m%%s%.log
goto end
::Exludes the cache and Application Cache Directories to speed up copy
::Creates a folder on the root of the drive the file is ran from to store data.
::The name of the folder is Chrome+History_[USERNAME]_[TIME]
::It also creates a log file with the same name on the root of teh drive the file is ran from.
:no
robocopy "%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default" "%CD%\Chrome_History_%USERNAME%_%h%%m%%s%" /E /TEE /LOG:"%CD%\Chrome_History_%USERNAME%_%h%%m%%s%.log" /XD "%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Cache" "%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Application Cache"
echo(
echo(
echo Data written to: %CD%\Chrome_History_%USERNAME%_%h%%m%%s%
echo Log written to: %CD%\Chrome_History_%USERNAME%_%h%%m%%s%.log
:end
echo Press any key to exit:
pause >nul
@echo off
echo ************************************************
echo ** **
echo **Verify that Firefox is not open and running!**
echo ** **
echo ************************************************
echo(
echo(
pause
set h=%TIME:~0,2%
set m=%TIME:~3,2%
set s=%TIME:~6,2%
robocopy "%USERPROFILE%\AppData\Roaming\Mozilla\Firefox\Profiles" "%CD%\FF_History_%USERNAME%_%h%%m%%s%" /E /TEE /LOG:"%CD%\FF_History_%USERNAME%_%h%%m%%s%.log"
echo(
echo(
echo Data files saved to: %CD%\FF_History_%USERNAME%_%h%%m%%s%
echo Log file saved to: %CD%\FF_History_%USERNAME%_%h%%m%%s%
echo(
echo Press any key to exit:
pause >nul