WshShell.SendKeys...VBS Script

WshShell.SendKeys...if you think about it there are many things you can do with this. For instance you can turn on or off the CAPS LOCK, NUMLOCK and SCROLL LOCK keys or even write a quick note. I know writing a note is over the top and inefficient but it can be fun to play a trick on your co-workers, friends or family especially if you share a pc! Let's get started...

The first thing you need to do is open up good ol' notepad. Then copy and paste the following script into notepad.

'Start Copy
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "notepad"
WScript.Sleep 100 'This gives notepad sometime to open
WshShell.AppActivate "Notepad"
WScript.Sleep 500
x=0
   do while x < 100
      WshShell.SendKeys "I know what you did last summer!"
      WshShell.SendKeys "{ENTER}"
      WScript.Sleep 100
   x=x+1
loop
'End Copy

then close notepad and when prompted save the file with what ever name of your liking, but change the extension from TXT to VBS. Then place it in your friend’s startup. Then the next time they log into their computer they will see notepad open and several lines of "I know what you did last summer!" will begin to write automagically! This is great for Halloween pranks!



Visit Winstructor to brush up on addtional functions...Website

0 comments: