Disabling the Clipboard
Below is a workaround method to disable the clipboard functionality using a batch script with some conditional logic and a loop. There's also a method and some instructions below that outlining how to easily kill the loop. It uses some dynamic VB scripting language to help keep the process hidden in the background while running but it still gives you the control to use it and kill it as needed.
IF /I [%~N1]==[KillSwitch] TASKKILL /F /FI "WindowTitle eq ClearClip" & EXIT
IF NOT DEFINED MINIMIZED SET MINIMIZED=1 && START "" /MIN "%~F0" x && EXIT
IF NOT [%~1]== GOTO :VBProcess
ping -n 02 127.0.0.1 > nul
cmd.exe /c echo off | clip
IF EXIST "%TempVBSFile%" DEL /F /Q "%TempVBSFile%"
ECHO Set WinScriptHost = CreateObject("WScript.Shell") >"%TempVBSFile%"
ECHO WinScriptHost.Run Chr(34) ^& "%~F0" ^& Chr(34), 0 >>"%TempVBSFile%"
ECHO Set WinScriptHost = Nothing >>"%TempVBSFile%"
CSCRIPT //nologo "%TempVBSFile%"
Essentially this. . .
Kills all processes with a title of "
ClearClip" if the "
KillSwitch" named file is passed to it as the first argument and
then exits the script entirely (see Killing it with the Kill
Starts [itself] the batch script again but minimized and with a passed dummy "
x" value first argument
Starts [itself] the batch script hidden with a dynamic VB script if the first argument passed to it is not null and then loops every 2
seconds clearing the clipboard
To use it
To use it or turn on the functionality to clear out the clipboard every 2 seconds, simply double-click or execute the batch script. If you have trouble or it does not work as expected, try running it elevated as administrator with a simple right-click | Run as administrator.
Killing it with the Kill Switch
- Create a file with the name of
KillSwitch.txt and place it right next to the batch script you saved that you execute to disable the clipboard
Drag and drop the
KillSwitch.txt name file right into or onto the batch script that you execute to disable the clipboard, and this will kill the hidden background processes that clears the clipboard and then clipboard will be available again.