Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

This is one of those pointless scripts that I have just done for a lab tech who is using an old PC and cutting / pasting lots large memory items in various apps. He needed something to clear the clipboard mem as sometimes it was pasting the wrong information.

After much googling we spotted that someone just opens up notepad, hits the spacebar and then copies the single character to the clipboard. It worked for him, and the lab tech so I just automated the process for him.

 

Written in AutoIT - compile and change what you want - if you ever feel you have the need for such a thing !!

 

; AutoIt Version:  	3.2.0.1
; Language:        	English
; Platform:        	WinXP
; Author:          	Matt ***** - ******@st-johns.org.uk
; Script Function: 	Clipboard Eraser
; Version:			0.5 Beta
; Date:				Nov 2007

#include 


$Form1 = GUICreate("ClipBoard Clearer", 220, 110, 348, 309)
$helpmenu = GUICtrlCreateMenu("Help")
$infoitem = GUICtrlCreateMenuitem("About", $helpmenu)
GUISetBkColor(0x0066FF)
$Button1 = GUICtrlCreateButton("Clear Clipboard", 10, 20, 89, 49, $BS_DEFPUSHBUTTON)
$Button2 = GUICtrlCreateButton("Spare Button", 120, 20, 89, 49, $BS_DEFPUSHBUTTON)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Select
	Case $nMsg = $Button1
		Run('c:\windows\notepad.exe', 'c:\windows')
		WinWait('Untitled - Notepad')
		Send('{space}')
		Sleep(1000)
		Send('^a')
		Sleep(1000)
		Send('^c')
		Sleep(1000)
		Send('!{F4}')
		WinWait('Notepad')
		Send('!n')
		MsgBox(0, "Clipboard Clearer", "Clipboard is now clear")
	Case $nMsg = $Button2
		MsgBox(64, "Spare Button", "This button does not do anything.")
	Case $nMsg = $infoitem
		MsgBox(0, "Clipboard Clearer 0.5 Beta", "Written By **** *****." & @CRLF & "Comments & Suggestions to:" & @CRLF & "******@st-johns.org.uk")
EndSelect
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit
EndSwitch
WEnd

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...