Clearing the ClipBoard

broom clean clear

Because of the work I do, I am often copying sensitive information and/or username and passwords, and I simply don’t like that type of information residing in the clipboard (windows memory) for extended periods of time. With all the spyware, viruses, malware, websites that try to harvest data, … it simply isn’t smart, this day in age, to leave such sensitive information available for bad actors.

Previously, I would open Excel, click on the dropdown around for the clipboard and use the Clear All command, but this become tedious to have to do over and over and over … so I created a simply VBA/VBScript file that resides on my desktop and I simply double-click to clear the clipboard. 2 Lines of code are all that are needed:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd.exe /c echo off | clip", 0, True

It’s as easy as that! Should you wish to integrate such functionality within an application (Access, Excel, …) the code uses Late Binding so is fully portable!