Clear browser history

Hi,

How to clear browser history using C# , and .net code or vb script

Please help because process is running in production

1 Like

Hi @Lakshya_Garg2

try this VB code in invoke code activity :

Dim chromeHistoryPath As String = "C:\Users\" & WRITE UR Environment UserName HERE & "\AppData\Local\Google\Chrome\User Data\Default\"

Dim filesToDelete As String() = {"History"}
    For Each fileName As String In filesToDelete
        Dim filePath As String = Path.Combine(chromeHistoryPath, fileName)
            If File.Exists(filePath) Then
                File.Delete(filePath)
            End If

I also suggest that you send hot key (Ctrl+Shft+Del) and send hotkey (Enter) while the browser window is open.This will directly clear the browser history

It is very simple -
Just delete the folder using appropriate activities -

Clearing cache basically means we have to remove a folder and cache will be cleared -
for firefox -
C:\Users%Userprofile%\AppData\Local\Mozilla\Firefox\Profiles\ .
for each cache2 folder in each profile folder in profiles

for chrome -
C:\Users%Userprofile%\AppData\Local\Google\Chrome\User Data\Default\Cache.

Mark it as a solution if it helps.