Windows – How to delete Google Chrome User Data files by prompt command

batch filecommand linegoogle-chromewindows

Would like to delete this folder and file:

DEL %LOCALAPPDATA%\Google\Chrome\"User Data"\Default*.* /F /S
DEL %LOCALAPPDATA%\Google\Chrome\"User Data"\First

Trying to execute in a batch file they don't work as expected. (Default folder still there after running).

Anything is wrong?

These files are from Google Chrome, so it's a just way to reset the browser by command prompt.

Best Answer

The Default folder is still there after running the batch file

DEL %LOCALAPPDATA%\Google\Chrome\"User Data"\Default*.* /F /S

You are missing a \ after Default.

The following command should work:

DEL %LOCALAPPDATA%\Google\Chrome\"User Data"\Default\*.* /F /S

But I don't want to be prompted

Add /Q to set "Quiet mode, do not give a Yes/No Prompt before deleting."

DEL %LOCALAPPDATA%\Google\Chrome\"User Data"\Default\*.* /F /S /Q

But I want to remove the directories as well.

Use rd to remove the directories

RD %LOCALAPPDATA%\Google\Chrome\"User Data"\Default /s /q

Further Reading