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

echo $null | clip.exe

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

Add-Type -AssemblyName System.Windows.Forms

2 thoughts on “PowerShell: Clear Windows Clipboard”

Leave a Reply

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