Sometimes it happens that the clipboard stops working. The routine of copy and paste we all rely on so many times a day suddenly refuses to do its job. The reason this happens is usually an application blocking the keyboard, making it impossible for other applications to get access to the clipboard. In order to fix this, one needs to find out which application is the culprit and either stop or restart the respective process in order to “free up” the clipboard. I put together a small PowerShell function (Clear-Clipboard), that does just that:
-
It identifies the process that currently blocks the clipboard (Using GetOpenClipboardWindow and GetWindowThreadProcessId API calls)
-
Opens a small GUI offering options to either stop or restart the process
Other than the mentioned Clear-Clipboard function. I’m also sharing Restart-Process as a separate function as it might be useful at times. Both can be downloaded from my GitHub repository.
https://gist.github.com/985cf4c0eaee0383e7f2
Photo Credit: Andi Campbell-Jones via Compfight cc