# Load necessary assemblies Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName PresentationFramework Add-Type -AssemblyName PresentationCore Add-Type -AssemblyName WindowsBase # Define paths $logFile = "$env:APPDATA\ClipboardClearMonitor.log" # Ensure log file exists if (-not (Test-Path $logFile)) { New-Item -ItemType File -Path $logFile -Force | Out-Null } # Log script start $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" Add-Content -Path $logFile -Value "$timestamp - Script started." # Display the log file path to the user Write-Host "------------------------------------------------------------" -ForegroundColor Cyan Write-Host "Clipboard monitoring started." -ForegroundColor Green Write-Host "Log file: $logFile" -ForegroundColor Yellow Write-Host "This window will display all clipboard changes." -ForegroundColor Green Write-Host "------------------------------------------------------------" -ForegroundColor Cyan # Notification function function Show-WindowsNotification { param ([string]$message) try { [System.Windows.Forms.NotifyIcon]$n = New-Object System.Windows.Forms.NotifyIcon $n.Icon = [System.Drawing.SystemIcons]::Information $n.BalloonTipTitle = "Clipboard Alert" $n.BalloonTipText = $message $n.Visible = $true $n.ShowBalloonTip(10000) Start-Sleep -Seconds 10 $n.Dispose() } catch { Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - Notification error: $($_.Exception.Message)" -ForegroundColor Red } } # Clipboard reader function Get-ClipboardContentSummary { try { $dataObj = [Windows.Forms.Clipboard]::GetDataObject() if ($dataObj -eq $null) { return "<null>" } $formats = $dataObj.GetFormats() if ($formats.Count -eq 0) { return "<empty>" } return ($formats -join ", ") } catch { $err = $_.Exception.Message $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" $logEntry = "$timestamp - Clipboard access error: $err" Add-Content -Path $logFile -Value $logEntry Write-Host $logEntry -ForegroundColor Red return "<unreadable>" } } try { $lastClipboardSummary = Get-ClipboardContentSummary while ($true) { Start-Sleep -Seconds 1 $currentSummary = Get-ClipboardContentSummary if ($currentSummary -ne $lastClipboardSummary) { $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" $logEntry = "$timestamp - Clipboard changed: $lastClipboardSummary → $currentSummary" Add-Content -Path $logFile -Value $logEntry Write-Host $logEntry if ($currentSummary -eq "<empty>" -or $currentSummary -eq "<null>" -or $currentSummary -eq "<unreadable>") { Show-WindowsNotification "Clipboard was cleared or inaccessible." } $lastClipboardSummary = $currentSummary } } } catch { $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" $logEntry = "$timestamp - FATAL ERROR: $($_.Exception.Message)" Add-Content -Path $logFile -Value $logEntry Write-Host $logEntry -ForegroundColor Red Pause } Pause
ClipboardClearMonitor.log This window will display all clipboard changes. ------------------------------------------------------------ 2025-07-17 12:43:57 - Clipboard changed: System.String, UnicodeText, Text, Locale, OEMText → HTML Format, System.St ring, UnicodeText, Text, Chromium internal source RFH token, Chromium internal source URL, Locale, OEMText 2025-07-17 12:44:18 - Clipboard changed: HTML Format, System.String, UnicodeText, Text, Chromium internal source RFH token, Chromium internal source URL, Locale, OEMText → System.String, UnicodeText, Text, Locale, OEMText 2025-07-17 12:48:17 - Clipboard changed: System.String, UnicodeText, Text, Locale, OEMText → <empty> 2025-07-17 12:49:25 - Clipboard changed: <empty> → System.Drawing.Bitmap, Bitmap 2025-07-17 12:51:56 - Clipboard changed: System.Drawing.Bitmap, Bitmap → HTML Format, System.String, UnicodeText, T ext, Chromium internal source RFH token, Chromium internal source URL, Locale, OEMText 2025-07-17 12:53:40 - Clipboard changed: HTML Format, System.String, UnicodeText, Text, Chromium internal source RFH token, Chromium internal source URL, Locale, OEMText → System.String, UnicodeText, Text, OEMText, CF_CLIPBOARDFUSIO N_DATAOBJECT, CF_CLIPBOARDFUSION_ITEM_SET, CF_CLIPBOARDFUSION_SCRUBBED 2025-07-17 12:53:50 - Clipboard changed: System.String, UnicodeText, Text, OEMText, CF_CLIPBOARDFUSION_DATAOBJECT, CF _CLIPBOARDFUSION_ITEM_SET, CF_CLIPBOARDFUSION_SCRUBBED → HTML Format, System.String, UnicodeText, Text, Chromium in ternal source RFH token, Chromium internal source URL, Locale, OEMText 2025-07-17 13:18:17 - Clipboard changed: HTML Format, System.String, UnicodeText, Text, Chromium internal source RFH token, Chromium internal source URL, Locale, OEMText → System.Drawing.Bitmap, Bitmap 2025-07-17 13:21:02 - Clipboard changed: System.Drawing.Bitmap, Bitmap → HTML Format, System.String, UnicodeText, T ext, Chromium internal source RFH token, Chromium internal source URL, Locale, OEMText 2025-07-17 13:22:13 - Clipboard changed: HTML Format, System.String, UnicodeText, Text, Chromium internal source RFH token, Chromium internal source URL, Locale, OEMText → System.String, UnicodeText, Text, OEMText, CF_CLIPBOARDFUSIO N_DATAOBJECT, CF_CLIPBOARDFUSION_ITEM_SET, CF_CLIPBOARDFUSION_SCRUBBED 2025-07-17 13:23:08 - Clipboard changed: System.String, UnicodeText, Text, OEMText, CF_CLIPBOARDFUSION_DATAOBJECT, CF _CLIPBOARDFUSION_ITEM_SET, CF_CLIPBOARDFUSION_SCRUBBED → HTML Format, System.String, UnicodeText, Text, Chromium in ternal source RFH token, Chromium internal source URL, Locale, OEMText 2025-07-17 13:24:38 - Clipboard changed: HTML Format, System.String, UnicodeText, Text, Chromium internal source RFH token, Chromium internal source URL, Locale, OEMText → System.String, UnicodeText, Text, Chromium internal source R FH token, Chromium internal source URL, Locale, OEMText 2025-07-17 13:27:12 - Clipboard changed: System.String, UnicodeText, Text, Chromium internal source RFH token, Chromi um internal source URL, Locale, OEMText → Rich Text Format, System.String, UnicodeText, Text
Edition Windows 10 Pro Version 22H2 Installed on OS build 19045.5965 Experience Windows Feature Experience Pack 1000.19061.1000.0
OriginalFilename : ClipC.dll.mui FileDescription : Client Licensing Platform Client ProductName : Microsoft® Windows® Operating System Comments : CompanyName : Microsoft Corporation FileName : C:\Windows\System32\clipc.dll FileVersion : 10.0.19041.1 (WinBuild.160101.0800) ProductVersion : 10.0.19041.1 IsDebug : False IsPatched : False IsPreRelease : False IsPrivateBuild : False IsSpecialBuild : False Language : English (United States) LegalCopyright : © Microsoft Corporation. All rights reserved. LegalTrademarks : PrivateBuild : SpecialBuild : FileVersionRaw : 10.0.19041.5915 ProductVersionRaw : 10.0.19041.5915 OriginalFilename : user32 FileDescription : Multi-User Windows USER API Client DLL ProductName : Microsoft® Windows® Operating System Comments : CompanyName : Microsoft Corporation FileName : C:\Windows\System32\user32.dll FileVersion : 10.0.19041.1 (WinBuild.160101.0800) ProductVersion : 10.0.19041.1 IsDebug : False IsPatched : False IsPreRelease : False IsPrivateBuild : False IsSpecialBuild : False Language : English (United States) LegalCopyright : © Microsoft Corporation. All rights reserved. LegalTrademarks : PrivateBuild : SpecialBuild : FileVersionRaw : 10.0.19041.5737 ProductVersionRaw : 10.0.19041.5737