There is a simple way to remove the browsing history from Chrome or Mozilla or Edge using Command-Line. You can also clear the data using short-cuts which I have mentioned below. Additionally, I have shared a few bonus tips that will clean your PC.
Delete Google Chrome’s browsing history using Command Prompt
1) Press Windows+R button together, type Notepad and click on OK.
2) Now, type or paste the following text on Notepad:
@echo off
set ChromeDir=C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data
del /q /s /f “%ChromeDir%”
rd /s /q “%ChromeDir%”
Here is a brief detail of each command:
- where echo is a batch script command line used to display or hide commands on the output screen.
- del deletes files in %ChromeDir% directory
- rd deletes %ChromeDir% directory
- /q stands for quiet mode and does not ask for confirmation of browser history deletion
- /s deletes subdirectory files
- /f stands for force delete
3) Now click on File at the top left side of the menu bar in Notepad and select the Save as an option.
4) Select the location where you want to save the file. Then, select All files in Save as type located at the bottom.
5) Next, in the Filename tab, name the file as per your wish and attach the extension .bat at the end. Then, Click on Save. This saves the text file in batch script file format.
6) Now, click on Start button, type Command Prompt, right-click and click on Run as administrator.
7) In the command prompt window, type path of the batch file created along with its name. For example: C:\Location\Path\of\Batch file folder\Batch-name.bat
8) Press the Enter key
9) Type exit to close the command prompt.
Now your command line is ready to clear browsing history from Chrome.
Bonus Tips and Tricks to Clear Browsing History from Chrome
1) Open Google Chrome Browser
2) Press Ctrl+Shift+Delete button together
3) This will open the Clear browsing data tab.
4) Click on Time Range dropdown and choose the time frame
5) Click on Clear data to remove the browsing history.
Now close the chrome and open it again, all history wiped out!
You may also want to know command line to clean up disk which will help to clear unwanted data from your computer.
If you want to delete Mozilla Firefox’s browsing history using Command Prompt, then follow the below steps:
1) Go to the search bar at your screen’s bottom and type “Notepad“. Once you find it, click on it and open it.
2) Now, type or paste the following text on Notepad:
@echo off
set DataDir=C:\Users\%USERNAME%\AppData\Local\Mozilla\Firefox\Profiles
del /q /s /f “%DataDir%”
rd /s /q “%DataDir%”
for /d %%x in (C:\Users\%USERNAME%\AppData\Roaming\Mozilla\Firefox\Profiles\*) do del /q /s /f %%x\*sqlite
3) Now, click on “file” in the menu bar and select “Save as” option.
4) Select the location to save the file. Then, select “All files” in “Save as type”
5) In the “Filename” tab, name the file as per your wish and attach the extension .bat at the end. Then, Click on “Save“.
6) Now, press Windows logo on a keyboard , type Command Prompt, right-click over it and select Run as Administrator:
7) In the command prompt window, type path of the batch file created along with its name.
8. Press Enter.
9. Type exit to close the command prompt.
There is third party software available that can not only remove browsing history but also clean up junk files from the system. You can find difference between CCleaner and Bleachbit here and decide which one to use.
If you want to delete Internet explorer’s browsing history, then follow the steps given below:
1) Click on the Start button, type Command Prompt, right-click over it and click on Run as administrator
2) If the “User Account Control” dialogue box appears, select Yes.
3) Once the Command Prompt window opens, type: Rexe InetCpl.cpl,ClearMyTracksByProcess 8 to delete internet files that are temporary. Then, press the Enter key.
4) To delete the entire web browsing history from your browser, type: Exe InetCpl.cpl, ClearMyTracksByProcess 1 and press Enter.
5) To delete cookies from your browser, type: exe InetCpl.cpl,ClearMyTracksByProcess 2 and press Enter.
6) To delete autofill data for forms, type: exe InetCpl.cpl,ClearMyTracksByProcess 16 and press Enter.
7) To delete passwords saved for different websites, type: exe InetCpl.cpl,ClearMyTracksByProcess 32 and press Enter.
8) To delete everything from browsing the history, cookies, form data, passwords and temporary internet files, type: exe InetCpl.cpl,ClearMyTracksByProcess 255 and press Enter.
9) To delete everything mentioned in step 8 along with settings and files saved by add-ons, type: exe InetCpl.cpl,ClearMyTracksByProcess 4351 and press Enter.
10) Close Command prompt by typing
Bonus Tips to Flush DNS using Command Line
1) Click on Start and type Command Prompt
2) Now Right-click on it and select Run as administrator
3) A pop-up window will appear, select Yes.
4) Once the Command Prompt window opens, type ipconfig /flushdns and press Enter. This will delete all the web browsing history.
5) Type exit to close Command Prompt.
The above command will work in Windows 10.