How could I delete Google Chrome User Data files by prompt command?

18,815

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

Share:
18,815

Related videos on Youtube

Marlon
Author by

Marlon

Enthusiastic about Devops tools, infrastructure and multicloud.

Updated on September 18, 2022

Comments

  • Marlon
    Marlon over 1 year

    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.

  • Biswapriyo
    Biswapriyo almost 7 years
    Most of the settings are saved in Preferences file in that default directory.
  • DavidPostill
    DavidPostill almost 7 years
    @Biswa So? The OP said "it's a just way to reset the browser by command prompt". Resetting the browser is a lot more than just preferences.
  • Biswapriyo
    Biswapriyo almost 7 years
    So alternatively, to reset user data, one may delete only the Preferences file, no need to remove whole default folder :)
  • DavidPostill
    DavidPostill almost 7 years
    @Biswa The OP wants to completely reset the browser. That folder also contains the cache, extension, extension settings, session storage, cookies, history etc ... which are all user data.