Posted On October 5, 2020

PowerShell: Clear Windows Clipboard

kimconnect 2 comments
blog.KimConnect.com >> Windows >> PowerShell: Clear Windows Clipboard

Many of us are using Remote Desktop nowadays. As such, clipboard can sometimes be out of sync when RDP is nested between many hosts. Therefore, we need a quick method to clear clipboard to resolve certain conditions.

Method 1: Set Null as value for the clipboard program

1
echo $null | clip.exe

Method 2: Use DotNet assembly to access clipboard’s Clear() method

1
2
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Clipboard]::Clear()

2 thoughts on “PowerShell: Clear Windows Clipboard”

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Quick 1-liner to Get a User’s Group Memberships

PS C:\Windows\system32> Get-ADPrincipalGroupMembership kimconnect|select name name ---- Domain Admins Enterprise Admins Cloud Admins Kimconnect Admins

PowerShell: Remediate Microsoft Windows Unquoted Service Path Enumeration

Description The remote Windows host has at least one service installed that uses an unquoted…

Microsoft Management Console Snap-in Shortcuts

Admin Snap-in Command Quality of Service Control Management ACSsnap.msc ADSI Edit ADSIedit.msc Authorization manager AZman.msc…
Other project: DragonCoin.com