en-US/about_OfficeScrubC2R.help.txt
TOPIC
about_OfficeScrubC2R SHORT DESCRIPTION Complete PowerShell/C# implementation of Microsoft's Office Scrub C2R tool with 10-50x performance improvements. LONG DESCRIPTION OfficeScrubC2R provides comprehensive removal of Office 2013, 2016, 2019, and Office 365 Click-to-Run installations when standard uninstall methods fail. This module is a complete port of Microsoft's OffScrubC2R.vbs v2.19, rewritten in PowerShell and C# for significantly improved performance and reliability. FEATURES - Native C# library for high-performance registry and file operations - Parallel processing for faster execution - Comprehensive logging and error handling - Support for Windows 7 SP1 through Windows 11 - Compatible with PowerShell 5.1 and PowerShell 7+ - Pre-compiled DLL with automatic source fallback - Full compatibility with original VBScript functionality REQUIREMENTS - Windows 7 SP1 or later - PowerShell 5.1 or later - .NET Framework 4.5 or later - Administrator privileges INSTALLATION From PowerShell Gallery: Install-Module -Name OfficeScrubC2R -Scope CurrentUser From GitHub: git clone https://github.com/Calvindd2f/OfficeScrubC2R Import-Module .\OfficeScrubC2R\OfficeScrubC2R.psd1 USAGE Basic usage (interactive): Invoke-OfficeScrubC2R Quiet mode (no prompts): Invoke-OfficeScrubC2R -Quiet -Force Detection only (no removal): Invoke-OfficeScrubC2R -DetectOnly Custom log path: Invoke-OfficeScrubC2R -LogPath "C:\Logs" Keep licenses: Invoke-OfficeScrubC2R -KeepLicense MAIN FUNCTIONS Invoke-OfficeScrubC2R Main function to remove Office C2R installations. Get-InstalledOfficeProducts Detects and returns installed Office C2R products. Test-IsC2R Tests if a path or value is related to Click-to-Run. Initialize-Environment Initializes the module environment and loads native components. Stop-OfficeProcesses Stops all running Office processes. PERFORMANCE Compared to the original VBScript (OffScrubC2R.vbs): - Registry operations: ~30x faster - File operations: ~15x faster - Overall execution: 10-50x faster depending on system state ARCHITECTURE The module consists of three main components: 1. OfficeScrubC2R.psm1 Main module file that exports functions and manages module loading. 2. OfficeScrubC2R-Utilities.psm1 PowerShell utilities module providing high-level operations. 3. OfficeScrubNative.dll Native C# library compiled from OfficeScrubC2R-Native.cs providing: - Registry operations with WOW64 support - File and folder operations - Process management - Windows Installer metadata cleanup - COM type library cleanup - License and SPP operations - Service management - GUID encoding/decoding ERROR CODES 0 - SUCCESS 1 - FAIL 2 - REBOOT_REQUIRED 4 - USERCANCEL 8 - STAGE1 (MSI uninstall failed) 16 - STAGE2 (Cleanup failed) 32 - INCOMPLETE 64 - DCAF_FAILURE 128 - ELEVATION_USERDECLINED 256 - ELEVATION 512 - SCRIPTINIT 1024 - RELAUNCH 2048 - UNKNOWN LOGGING Logs are created in the following location by default: $env:TEMP\OfficeScrubC2R\<ComputerName>_<Timestamp>_ScrubLog.txt You can specify a custom log path using the -LogPath parameter. SAFETY The tool includes several safety features: - Detection-only mode for dry runs - Confirmation prompts (unless -Force is used) - Comprehensive logging of all operations - Automatic reboot scheduling for locked files - Process termination with graceful fallback TROUBLESHOOTING If the DLL fails to load: 1. Ensure DLL is in the same directory as the module 2. Run: Unblock-File .\OfficeScrubNative.dll 3. Verify .NET Framework 4.5+ is installed 4. The module will fallback to compiling from source If removal is incomplete: 1. Reboot the system 2. Run the tool again after reboot 3. Check the log file for details For permissions errors: 1. Ensure you're running as Administrator 2. Check if any Office processes are still running 3. Temporarily disable antivirus EXAMPLES Example 1: Interactive removal PS> Invoke-OfficeScrubC2R This will prompt for confirmation and show progress. Example 2: Silent removal PS> Invoke-OfficeScrubC2R -Quiet -Force Removes Office without any prompts or confirmation. Example 3: Detection only PS> Invoke-OfficeScrubC2R -DetectOnly Shows what would be removed without actually removing anything. Example 4: Keep licenses PS> Invoke-OfficeScrubC2R -KeepLicense Removes Office but preserves license information. Example 5: Custom log location PS> Invoke-OfficeScrubC2R -LogPath "C:\IT\Logs" Saves the log file to a custom location. SEE ALSO - Invoke-OfficeScrubC2R - Get-InstalledOfficeProducts - Test-IsC2R - https://github.com/Calvindd2f/OfficeScrubC2R KEYWORDS Office, Click-to-Run, C2R, Uninstall, Removal, Scrub, Office365, O365 COPYRIGHT (c) 2025 Calvin. All rights reserved. MIT License. Derived from Microsoft OffScrubC2R.vbs. |