delete multiple via command line script on windows

Forums: 

Suppose I want to delete everything without a preview. There should be a way to do this from the command line in windows for batch file support.

something like:

bleachbit_console.exe -d *.*

or even:

bleachbit_console.exe -ini BleachBit.ini -d

To delete everything checked (True) in the ini file.

You can't possibly expect a script to go through each possible cleaning option.

I do understand the -ini option (great idea), but you really want to delete everything? I purposefully left out the *.* option because
1. Some options are very slow and often unnecessary (e.g., "free disk space" and "memory").
2. Some people seem not to carefully consider each option and later complain. (That's why I recently removed the Firefox - Places option.)
3. Options change, so in a future release *.* could mean something else

Knowing these risks, here is a way to do preview everything (like *.*) with Linux commands

bleachbit --list | grep -E "[a-z]+\.[a-z]+" | xargs bleachbit --preview

I see in your comment, though, that you run Windows instead. I don't know of a way to do the same in Windows. You may already know you do not have to list each option (firefox.cache firefox.history), so you can shorten the command line like this

bleachbit.exe --delete firefox.* google_chrome.* flash*

---
Andrew, lead developer

Create a .bat file reflecting the items you want to run and then execute this as a scheduled task.

Example .bat file

"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.clipboard
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.logs
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.memory_dump
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.muicache
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.prefetch
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.tmp
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.history
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.mru
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.backup_files
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.cache
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.logs
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.tmp
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.mru
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system_defender.history
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system_explorer.mru
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system_explorer.recent_documents
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system_explorer.run
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system_explorer.search_history
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system_explorer.thumbnails
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system_media_player.mru
"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.free_disk_space

Tip: you can combine options like this (say you want the four)

"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system.cache system.logs system.tmp system.mru

If you want them all, use a star

"C:\Program Files\BleachBit\bleachbit_console.exe" --delete system_explorer.*

A recent feature available now is the following which uses whichever check boxes you set earlier in the GUI

"C:\Program Files\BleachBit\bleachbit_console.exe" --present

Recently someone filed an interesting suggestion in the bug tracker: in the GUI check the options you want, and then BleachBit will give you the command line to match. (This is not yet implemented.)

---
Andrew, lead developer

Hi I don't know if the delete command is working for you but for me it isn't and I am using the -c or --clean command instead.

What I am trying to do is a .bat file that Cleans what I choose to Clean, right now I have designed like this:

"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.clipboard
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.logs
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.memory_dump
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.muicache
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.prefetch
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.tmp
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.history
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.mru
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.backup_files
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.cache
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.logs
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.tmp
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.mru
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.updates
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system_defender.history
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system_explorer.mru
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system_explorer.recent_documents
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system_explorer.run
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system_explorer.search_history
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system_explorer.thumbnails
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c system.free_disk_space
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c deepscan.backup
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c deepscan.ds_store
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c deepscan.thumbs_db
"C:\Program Files\BleachBit\bleachbit_console.exe" --no-uac -c deepscan.tmp
pause

I added the pause command to see if BleachBit cleaned anything but it didn't, and it is too fast as well! It is not cleaning anything, and I was wondering if anyone has a working .bat file, or can advice me in how to make correct command lines. I have also tried to combine options like andrew suggests, but is isn't working either. Why?

I do agree in this: "Recently someone filed an interesting suggestion in the bug tracker: in the GUI check the options you want, and then BleachBit will give you the command line to match. (This is not yet implemented.)"

Please BleachBit, add this option, since I will be able to get working commands (I hope) through this procedure at least!

Hans, a first step in troubleshooting is making sure that BleachBit is starting at all. The path BleachBit is installed in may vary because of language or whether Windows is 32-bit. Try starting simply with one command, and verify BleachBit starts (instead of getting an error like "the system cannot find the path specified")

"%ProgramFiles(X86)\BleachBit\BleachBit_console.exe" --clean system.tmp
pause

Let me know the output of this command.

---
Andrew, lead developer