28-06-24 07:56 PM
Team,
Anyone developed a process to delete Browser history, cache and cookies?
Currently we are performing the activity manually to speed up browser. TIA.
29-06-24 09:52 PM
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:
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:
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.
01-07-24 06:17 AM
In MS Edge you can take a look at below option and try it. It deletes all history upon closing.
03-07-24 05:25 PM
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.
03-07-24 05:32 PM
Hi @naga007 ,
Are you able to manually navigate through file explorer using the path:
%LocalAppData%\Google\Chrome\User Data\Default\
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.