-1

So I made a bot to do some task with google chrome and it created many google chrome profile. And now I am done with that task so I want to delete all my created google chrome profile.

NB:

  • I already deleted the profile folder in %LOCALappdata%\Google\Chrome\User Data. The folder successfully deleted but the profile still appear in chrome startup window.

A lot of chrome profile

1 Answer 1

3

If you still need help with this, I made a PowerShell script that removes Google Chrome's profile data.

It stops any chrome processes currently running, then targets:

  • Profile # and Default directories
  • Local State file

Located in:

%LOCALAPPDATA%\Google\Chrome\User Data

$UserData = "$($env:LOCALAPPDATA)\Google\Chrome\User Data"

$Folders = Get-ChildItem $UserData | Where-Object{ $_.PSIsContainer -and $_.Name -eq "Default" -or $_.Name -like "Profile*"}

$FoldersFullPath = $Folders.FullName 


if ($Null -ne (get-process 'chrome' -ErrorAction SilentlyContinue)){
    stop-process -ProcessName 'chrome'
    Start-Sleep -Seconds 5
}

$FoldersFullPath | ForEach-Object {
    if (Test-Path -Path $_){
        Remove-Item -Recurse -Path $_
    }
}

if (Test-Path -Path "$UserData\Local state"){
    Remove-Item -Path "$UserData\Local state"
}

I'm sure you can use this to help you re-create it in Python, in fact, this is a good excuse to learn Python myself.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.