Here is a simple way to delete all files and folders that have a certain name inside:
Here is a simple way to delete all files and folders that have a certain name inside:
Here is a way to delete all folders that have "coffee" in them inside your C drive. This includes hidden spots like AppData or ProgramData. You can use this script:
Start a new PowerShell window and type the following commands one after another without pressing Enter in between them so they run together:
Copy these lines into your Command Prompt (cmd) or PowerShell:
```powershell
# Tell Windows to ignore special folders for this command
Set-Location -Path C:\
Get-ChildItem -Filter coffee -Recurse -Force | Remove-Item -Recurse -Force
```
When you finish typing the commands, press **Enter** only once at the very end. This will go through every folder looking for "coffee" and delete it if found. If there are no folders with that name, nothing will happen and your computer stays safe.
I bought the free version of BareGrep so I could search every file that mentions it and find all the folders related to it. Since I use this tool every day, my professional license was worth more than just buying one for work. As a developer, you can see how important having such a tool is.
Did your computer catch a bad virus? Maybe that's why it created extra folders or files inside each drive, level by level.
Check your spelling carefully when using strings. FYI: https://stackoverflow.com/questions...or...powershell http://www.powershellcookbook.com/recipe...-a-pattern https://docs.microsoft.com/en-us/po...or...rshell-7.1 One thing to watch: Make sure you are looking for files that have the word "coffee" in their name. Look at the results first so your script doesn't accidentally delete or change things you don't want it to. Then pipe into Remove-Item. Test on copies of the folders too just in case. Back up everything before running this thing because Remove-Item can be too strong sometimes.
No, that's a long-standing program I really want to get rid of! I already took out all the registry stuff related to it. Now I need to delete every single folder too. When I looked manually on "AppData and ProgramData", some folders were still there in other parts of my drive.
Use baregrep, free version to find every file that mentions it and check all folders in your search area. Bare Metal Software > BareGrep - Free grep for Windows I bought a license for the professional version because I use them all the time baretail too. As a developer you can see how important a tool it is