This repository contains three command prompt scripts for automating tasks with BleachBit: BleachBitList.cmd, BleachBitClean.cmd, and BleachBitOverwrite.cmd. These scripts list available cleanup options, streamlines system cleanup, and secures data by overwriting deleted files.
- Overview
- Requirements
- Script Description
- BleachBit List Script
- BleachBit Clean Script
- BleachBit Overwrite Script
- Usage
- Testing
- Notes & Troubleshooting
- Credits
Bleachbit is a system cleanup and privacy tool. These scripts enhance it's usability by automating key functions:
-
- Lists all available cleanup options in the Command Prompt terminal.
-
- Cleans data for specified applications and system components.
-
- Overwrites data for specified applications and system components.
- BleachBit installed on your system. Download Here
- Administrative privileges for certain cleanup tasks and overwriting.
- Ensure BleachBit's installation matches the path in the scripts (C:\Program Files(x86)\BleachBit). Modify if necessary.
Lists all availble cleaners and their subsections.
- Outputs a detailed list of all cleanup operations on the device supported by BleachBit.
- Helps users identify specific cleaners to customize BleachBitRun.cmd.
- Suppresses confirmation prompts for seamless operation.
- Sets console encoding and Python I/O Environment for compatibility.
- Navigates to the BleachBit installation directory
- Executes the list command (
-l) to display all available cleaners. - Pauses Command Prompt to allow for list viewing.
bleachbit_console.exe -l
Automates cleaning for commonly used applications and system files.
- Outputs a detailed list of all cleanup operations on the device supported by BleachBit.
- Helps users identify specific cleaners to customize BleachBitRun.cmd.
- Suppresses confirmation proimpts for seamless operation.
- Sets console encoding and Python I/O Environment for compatibility.
- Navigates to the BleachBit installation directory
- Executes the list command (
-c) to display all available cleaners. - Pauses Command Prompt to allow for completion confirmation.
bleachbit_console.exe -c adobe_reader.* -s
Automates the secure overwriting of data from commonly used applications and system files, preventing recovery of sensitive information.
- Executes BleachBit's
-overwritecommand for a range of applications and system components. - Ensures all data is securely erased beyond recovery.
- Suppresses confirmation prompts for seamless operation.
- Sets console encoding and Python I/O Environment for compatibility.
- Navigates to the BleachBit installation directory.
- Executes secure overwriting commands for various components.
- Pauses Command Prompt to allow for completion confirmation.
bleachbit_console.exe -overwrite adobe_reader.* -s
- Open Command Prompt.
- Navigate to the script's directory.
- Execute the script:
BleachbitList.cmd
- Open File Explorer.
- Navigate to the script's directory.
- Double click BleachBitClean.cmd.
- Open Command Prompt.
- Navigate to the script's directory.
- Execute the script:
BleachbitClean.cmd
- Open File Explorer.
- Navigate to the script's directory.
- Double click BleachBitClean.cmd.
- Open Command Prompt.
- Navigate to the script's directory.
- Execute the script:
BleachBitOverwrite.cmd
- Open File Explorer.
- Navigate to the script's directory.
- Double click BleachBitOverwrite.cmd.
This section outlines the testing procedures, results, and observations for the script to ensure functionality and reliability. It provideds a step-by-step guide to verify the script's operations and identify any potential issues.
-
- Windows 10 Pro
- Windows 11 Pro
-
- 4.6.2
-
- Administrator
-
-
RAM:
- DDR4
- 4GB
- 8GB
- 16GB
- DDR4
-
Processor:
- 11th Gen Intel Core i3
- 11th Gen Intel Core i5
- 12th Gen Intel Core i5
- 13th Gen Intel Core i5
- AMD Ryzen 5
- AMD Ryzen 7
-
Disk Drive:
- BG6 Kioxia
- CLI-3D1280Q11 NVMe SSSTC
- Generic Flash Disk USB Device
- Intel SSDSC2BF180A4H
- NVMe Micron 2550
- NVMe BC711
- NVMe BC901
- NVMe CL1-3D128-Q11
- NVMe KBG50ZNS256G
- NVMe Micron 2450
- NVMe SN530
- NVMe SN740
- NVMe PM991
- NVMe PC801
- NVMe PM991
- NVM PM9B1
- SanDisk SD8SN8U
- ST500M000
-
-
-
Confirm BleachBit is installed in the specified directory.
C:\Program Files (x86)\BleachBit -
Open Command Prompt with the required privileges (Administrator).
-
Backup any important data to avoid accidental loss during testing.
-
-
-
Navigate to the directory containing the script.
-
Run the following command:
BleachBitList.cmd -
Receive Results.
-
Run the following command:
BleachBitClean.cmd -
Receive Results.
-
Run the following command:
BleachBitOverwrite.cmd -
Receive Results.
-
-
- Verify that
-loperation is executed without errors. - Verify that each
-coperation is executed without errors. - Verify that each
-overwriteoperation is executed without errors. - Monitor the system for any unexpected performance issues or errors during execution.
- Verify that
-
-
Confirm Endpoint is in Action1's Endpoint Library.
-
Confirm Endpoint is Connected.
-
Confirm BleachBit is installed in the specified directory.
C:\Program Files(x86)\BleachBit -
Confirm scripts are in Script Library in Action1.
-
-
- Select Endpoint in Action1's Endpoint Library.
- Select "Run Script".
- Select "Script Library"
- Select "BleachBitList"
- Select "Next Step"
- Select "Next Step"
- Set Automation Name, Automation Run Settings, and Retry settings.
- Select "Finish"
- Receive Results.
- Select Endpoint in Action1's Endpoint Library.
- Select "Run Script".
- Select "Script Library"
- Select "BleachBit Clean"
- Select "Next Step"
- Select "Next Step"
- Set Automation Name, Automation Run Settings, and Retry settings.
- Select "Finish"
- Receive Results.
- Select Endpoint in Action1's Endpoint Library.
- Select "Run Script".
- Select "Script Library"
- Select "BleachBit Overwrite"
- Select "Next Step"
- Select "Next Step"
- Set Automation Name, Automation Run Settings, and Retry settings.
- Select "Finish"
- Receive Results.
-
- Verify that
-loperation is executed without errors. - Verify that each
-coperation is executed without errors. - Verify that each
-overwriteoperation is executed without errors. - Monitor the system for any unexpected performance issues or errors during execution.
- Verify that
BleachBit List
| Test Case | Expected Outcome | Actual Outcome | Status |
|---|---|---|---|
| Verify Script Execution | Script Executes without Errors | Pass | Pass |
| Verify List of Cleaners | Displays all available cleaners in UTF-8 encoding | Pass | Pass |
| Verify descriptions accuracy | Cleaner descriptions are clear and complete | Pass | Pass |
| Handle missing installation | Proper error message if BleachBit is not installed | Pass | Pass |
BleachBit Clean:
| Test Case | Expected Outcome | Actual Outcome | Status |
|---|---|---|---|
| Verify Script Execution | Script Executes without Errors | Pass | Pass |
| Clean Adobe Reader | Temporary Files and logs removed | Pass | Pass |
| Clean Deep Scan | Detects and removes orphaned files, unnecessary temp files, and logs | Pass | Pass |
| Clean Google Chrome | Cache and browsing data cleaned | Pass | Pass |
| Clean Windows System | Recent file lists and temporary files removed | Pass | Pass |
| Handle Missing installation | Proper error if BleachBit is not installed | Pass | Pass |
| Suppress prompts | Script runs without manual confirmation | Pass | Pass |
BleachBit Overwrite:
| Test Case | Expected Outcome | Actual Outcome | Status |
|---|---|---|---|
| Verify Console Encoding | Console encoding is set to UTF-8 without issues | Pass | Pass |
| Overwrite Adobe Reader | All associated files are securely overwritten | Pass | Pass |
| Overwrite Deep Scan | Temporary files identified and overwritten securely | Pass | Pass |
| Overwrite Google Chrome | Cache and history files are overwritten securely | Pass | Pass |
| Overwrite Windows System | System temp files securely overwritten | Pass | Pass |
BleachBit List
| Test Case | Expected Outcome | Actual Outcome | Status |
|---|---|---|---|
| Verify Script Execution | Script Executes without Errors | Fail | Pass |
| Verify List of Cleaners | Displays all available cleaners in UTF-8 encoding | Pass | Pass |
| Verify descriptions accuracy | Cleaner descriptions are clear and complete | Pass | Pass |
| Handle missing installation | Proper error message if BleachBit is not installed | Pass | Pass |
BleachBit Clean:
| Test Case | Expected Outcome | Actual Outcome | Status |
|---|---|---|---|
| Verify Script Execution | Script Executes without Errors | Fail | Pass |
| Clean Adobe Reader | Temporary Files and logs removed | Pass | Pass |
| Clean Deep Scan | Detects and removes orphaned files, unnecessary temp files, and logs | Pass | Pass |
| Clean Google Chrome | Cache and browsing data cleaned | Pass | Pass |
| Clean Windows System | Recent file lists and temporary files removed | Pass | Pass |
| Handle Missing installation | Proper error if BleachBit is not installed | Pass | Pass |
| Suppress prompts | Script runs without manual confirmation | Pass | Pass |
BleachBit Overwrite:
| Test Case | Expected Outcome | Actual Outcome | Status |
|---|---|---|---|
| Verify Script Execution | Script Executes without Errors | Fail | Pass |
| Overwrite Adobe Reader | All associated files are securely overwritten | Pass | Pass |
| Overwrite Deep Scan | Temporary files identified and overwritten securely | Pass | Pass |
| Overwrite Google Chrome | Cache and history files are overwritten securely | Pass | Pass |
| Overwrite Windows System | System temp files securely overwritten | Pass | Pass |
No Errors.
Good for Remote Testing.
C:\Program Files (x86)\BleachBit\library.zip\win_unicode_console\__init__.py:31: RuntimeWarning: sys.stdin.encoding == 'utf-8', whereas sys.stdout.encoding == 'cp1252', readline hook consumer may assume they are the same
exception when getting special folder path for documents
exception when getting special folder path for music
exception when getting special folder path for pictures
exception when getting special folder path for video
Research reasoning on why Action1 Ran script would create this error.
The BleachBitClean.cmd script performs as intended in local environments, reliably cleaning temporary files, caches, and logs for specified applications and system components. The -c command executes without errors, and the inclusion of the -s flag ensures seamless, prompt-free operation. However, during remote testing, a Runtime Error related to encoding was encountered despite the script explicitly setting the console encoding to UTF-8 using the chcp 65001 command and the Python I/O environment variable. This discrepancy suggests an environment-specific issue rather than a fault in the script logic.
-
Verify Remote Environment Configuration:
- Ensure the remote testing environment supports UTF-8 encoding for both the console and Python processes.
- Confirm that the remote environment has the required permissions to execute the script.
-
Add Encoding Validation in the Script:
-
Include a diagnostic step in the script to explicitly verify the console’s encoding settings. For example:
chcp
-
-
Fallback Encoding Mechanism:
-
Implement a fallback mechanism to set encoding explicitly in case the default settings fail. For example:
set PYTHONUTF8=1
This environment variable enforces UTF-8 mode for Python-based tools in modern Windows environments.
-
-
Log Error Details:
- Add an error logging feature to capture specific runtime error messages during remote execution. This can help diagnose whether the issue stems from encoding, permissions, or system limitations.
-
Update Documentation:
- Include a troubleshooting section in the ReadMe to address potential runtime errors related to encoding in remote environments.
-
Investigate Remote Runtime Error:
Conduct detailed testing in the remote environment to identify whether the encoding issue is related to the host system configuration, network settings, or script execution context.
-
Implement Diagnostic Logging:
Enhance the script to log execution steps and errors into a log file for remote environments. Example:
BleachBitClean.cmd > execution_log.txt 2>&1 -
Test on Diverse Remote Systems:
Expand testing to multiple remote systems with varying configurations (e.g., different Windows versions, virtual environments) to identify potential patterns.
-
Provide Alternate Execution Instructions:
If the issue persists, recommend running the script locally or through remote desktop access instead of remote shell environments where encoding issues are more common.
By addressing these recommendations and next steps, the script can achieve consistent performance across both local and remote environments.
This error may occur due to incompatible environment settings. Ensure the script's encoding matches the console's settings.
-
Verify the Python I/O environment variable:
set Pythonioencoding=UTF-8 -
Run the script as Administrator
Update the cd command in both scripts if BleachBit is installed in a non-default location.
Copyright © 2008-2023 Andrew Ziem. Thank you to all contributors. User contributed content, such as forum posts and comments, is copyrighted by the contributors. The BleachBit source code is copyrighted under the GNU General Public License version 3. Unless otherwise noted, the web page content is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 license and screenshots of BleachBit as public domain. The logo is copyrighted under the GPL. See the privacy policy.
For additional information, visit the Bleachbit Documentation.
Copyright 2024 Christine Bettencourt Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.