Overview
BCU-console is designed for automation and can be integrated into various scripting environments. This guide provides practical examples for common automation scenarios.Script Templates
Batch Scripts
Traditional Windows batch files for simple automation tasks
PowerShell
Modern PowerShell scripts with error handling and logging
Task Scheduler
Scheduled automation using Windows Task Scheduler
Enterprise Deployment
SCCM, Intune, and Group Policy integration examples
Basic Automation Patterns
Simple Unattended Uninstall
The most basic automation: uninstall applications silently without user interaction.With Logging
Capture console output for audit trails and troubleshooting.With Error Handling
Robust error handling for production environments.Common Automation Scenarios
Scenario 1: Enterprise Bloatware Removal
Automatic removal of unwanted software on new workstations.Scenario 2: Software Inventory Collection
Regular inventory collection for compliance and asset management.Scenario 3: Pre-Deployment Cleanup
Remove old software versions before deploying new ones.Scenario 4: Scheduled Maintenance
Regular cleanup of temporary software and trial versions.PowerShell - Task Scheduler Script
Windows Task Scheduler Integration
Create Scheduled Task (Command Line)
Create Task
Create Scheduled Task (PowerShell)
PowerShell Task Creation
Enterprise Deployment Integration
Microsoft Endpoint Configuration Manager (SCCM)
SCCM Package Script
Microsoft Intune (PowerShell Script Deployment)
Intune Deployment Script
Best Practices
Always Test First
Always Test First
Never use unattended mode without thorough testing
- Run without
/Uflag first to see what will be uninstalled - Test on a non-production machine
- Verify the uninstall list is specific enough to avoid false positives
- Review logs after test runs
Use Logging
Use Logging
Always log operations for audit trails and troubleshooting
- Redirect output to log files
- Include timestamps in log filenames
- Store logs in a central location
- Implement log rotation to prevent disk space issues
Check Return Codes
Check Return Codes
Always verify operation success via return codes
- Check
$ERRORLEVEL(batch) or$LASTEXITCODE(PowerShell) - Implement appropriate error handling
- Send alerts on failures
- Don’t proceed with dependent operations if BCU fails
Use Junk Cleanup Carefully
Use Junk Cleanup Carefully
Start with VeryGood confidence level
- Only use
/J=VeryGoodfor automated tasks - Never use lower confidence levels in unattended mode
- Test junk cleanup results before deploying widely
- Monitor for false positives
Verify File Paths
Verify File Paths
Always validate paths before execution
- Check if .bcul files exist before running
- Verify BCU-console.exe is accessible
- Ensure output directories exist for exports
- Use absolute paths when possible
Schedule Appropriately
Schedule Appropriately
Run during maintenance windows
- Schedule during off-hours (e.g., 2-4 AM)
- Allow sufficient time for completion
- Avoid running during backups or other maintenance
- Consider user logon/logoff times
Common Pitfalls
Troubleshooting
Exit Code 1 - Invalid Arguments
Exit Code 1 - Invalid Arguments
Cause: Command syntax error or invalid junk levelSolutions:
- Verify command syntax matches documentation
- Check that switches are spelled correctly (/Q, /U, /V, /J)
- Ensure junk level is valid (VeryGood, Good, Questionable, Bad, Unknown)
Exit Code 87 - Invalid Syntax
Exit Code 87 - Invalid Syntax
Cause: Missing file or invalid pathSolutions:
- Verify .bcul file exists at specified path
- Use absolute paths instead of relative paths
- Check file permissions
- Ensure filename is provided for export command
Exit Code 1223 - User Cancelled
Exit Code 1223 - User Cancelled
Cause: User pressed ‘N’ at confirmation promptSolutions:
- Use
/Uflag to skip confirmations - Or ensure user understands they need to press ‘Y’
No Applications Matched
No Applications Matched
Cause: Uninstall list doesn’t match any installed applicationsSolutions:
- Run
BCU-console listto see what’s installed - Verify the .bcul file was created correctly
- Check if target applications are already uninstalled
- Ensure .bcul file was created on same architecture (x86/x64)
Next Steps
CLI Overview
Learn about BCU-console features and use cases
Command Reference
Complete documentation of all commands and flags
