Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Without deleting Chrome bookmarks, how to delete cookies, cache and history with a batch file

Writer Sophia Terry

Below is the script I am using which is deleting bookmarks as well:

@echo off
set ChromeDir=C:\Users\%UserName%\AppData\Local\Google\Chrome\User Data
del /q /s /f "%ChromeDir%"
rd /s /q "%ChromeDir%"

2 Answers

From my testing, it seems you can backup the Bookmarks file in C:\Users\%UserName%\AppData\Local\Google\Chrome\User Data\Default, delete the folder and then restore it.

I created the following batch file based on yours:

@echo off
set TempDir=%TEMP%\ChromeBookmarks
set ChromeDir=C:\Users\%UserName%\AppData\Local\Google\Chrome\User Data
mkdir "%TempDir%"
copy "%ChromeDir%\Default\Bookmarks" "%TempDir%"
del /q /s /f "%ChromeDir%"
rd /s /q "%ChromeDir%"
mkdir "%ChromeDir%\Default"
copy "%TempDir%\Bookmarks" "%ChromeDir%\Default"
del /q /s /f "%TempDir%"
rd /s /q "%TempDir%"

This backs up the Bookmarks file before removing the User Data directory and restores it after. When you then open Chrome, it will use the existing Bookmarks file and refill the rest of the User Data directory with new data.

Follow this step:

  1. open chrome goto Settings->Bookmarks->Bookmark Manager and then Export bookmark as html file and save it to desktop.

  2. Then run your batch file it will delete all cookies, cache, history and bookmark also.

  3. But now you have a backup of your Bookmarks on your desktop so now all you have to do is open chrome again and goto Settings->Bookmarks->Bookmark Manager and import bookmark from that html file.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy