cancel
Showing results for 
Search instead for 
Did you mean: 

Auto Delete History, Cache and Cookies

naga007
Level 3

Team,

Anyone developed a process to delete Browser history, cache and cookies?

Currently we are performing the activity manually to speed up browser. TIA.

 

4 REPLIES 4

Hi @naga007 ,

In order to achieve this, you can create a batch file by opening Notepad application and entering the below code:

 

:: Close Chrome if it's running
taskkill /F /IM chrome.exe >nul 2>&1

:: Delete browsing data
rd /s /q "%LocalAppData%\Google\Chrome\User Data\Default\Cache"
rd /s /q "%LocalAppData%\Google\Chrome\User Data\Default\Cookies"
rd /s /q "%LocalAppData%\Google\Chrome\User Data\Default\History"

:: Close Edge if it's running
taskkill /F /IM msedge.exe >nul 2>&1

:: Delete browsing data
rd /s /q "%LocalAppData%\Microsoft\Edge\User Data\Default\Cache"
rd /s /q "%LocalAppData%\Microsoft\Edge\User Data\Default\Cookies"
rd /s /q "%LocalAppData%\Microsoft\Edge\User Data\Default\History"

 

 

Save this file as a .bat file as in my case, I have saved it as ClearBrowserData.bat:

devneetmohanty07_0-1719693730951.png

 

Now, in the Process Studio, you can use the Start Process action from Function for Utility - Environment - 10.1.1 business object and pass the batch file path as the parameter value for Application input argument:

devneetmohanty07_1-1719694017859.png

 

Once you run this flow, it should close both Chrome and Edge browsers and should also delete caches, cookies and history.

---------------------------------------------------------------------------------------------------------------------------------------

Hope this helps you out and if so, please mark the current thread as the 'Answer' so others can refer to the same for reference in future.

Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

 

 

 

 

 

---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

In MS Edge you can take a look at below option and try it. It deletes all history upon closing.

Tejaskumar_Darji_0-1719811016411.png

 

Hi @devneetmohanty07 , thanks for your time. I'm getting below error while trying to run the script on Windows 2019 server. I'm I missing anything here? Getting same error even when running the whole script via batch file.

naga007_0-1720023723615.png

 

Hi @naga007 ,

Are you able to manually navigate through file explorer using the path:

%LocalAppData%\Google\Chrome\User Data\Default\

devneetmohanty07_0-1720024163525.png

 

If no, then try to see what chrome profile you have under the User Data folder. Mine is configured on Default profile. If in your case, there is a specific username folder, then the path would change:

%LocalAppData%\Google\Chrome\User Data\<User_Name>\

See for your system where do you find the Cookies and the other folders. Change those in my provided script.

---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.