I am retiring this website. Please visit my new blog here for all things tech-related: goo.gl/d7D1J
Showing posts with label VBS File. Show all posts
Showing posts with label VBS File. Show all posts

Friday, April 10, 2009

VBS - Open CD/DVD Drive Repeatedly

This code makes the CD/DVD tray open and close repeatedly until shutdown.

(Or you could just press ctrl + alt + delete>processes>end wscript.exe. Save this as .vbs.

Set oWMP = CreateObject(”WMPlayer.OCX.7″ )
Set colCDROMs = oWMP.cdromCollection
if colCDROMs.Count >= 1 then
do
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next ‘ cdrom
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next ‘ cdrom
loop
end if

Thursday, April 9, 2009

VBS - Types "whatever" repeatedly

This VBS file will type whatever you choose over and over on any text field you have selected. This serves no real reason but to play a joke on someone.

1. Open Notepad and type:

Set wshShell = wscript.CreateObject("WScript.Shell")
do
wscript.sleep 100
wshshell.sendkeys "You are a fool."
loop


2. Save as .vbs.

(You can edit the "You are a fool." in my code to whatever you like.)

VBS - Open CD/DVD Drive

This is a VBS file that will open the cd/dvd drive of the computer the script is run on. This could be used if your drive open/close button is broken, or just to mess with someone. :)

1. Open notepad.
2. Type:

Set oWMP = CreateObject(”WMPlayer.OCX.7″ )
Set colCDROMs = oWMP.cdromCollection

if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next ‘ cdrom
End If


3. Save as .vbs.

VBS - Caps Lock “on off” loop

This is a vbs file. A vbs file stands for “VBScript”. It’s kind of like a batch file. You have to save it in a different format is all. This one I’ll show is a vbs file that will turn your caps lock on and off repeatedly. It is intended for no purpose except to annoy someone. Here it is:
1. Open notepad.
2. Type:

Set wshShell =wscript.CreateObject(”WScript.Shell”)
do
wscript.sleep 100
wshshell.sendkeys “{CAPSLOCK}”
loop


3. Save it somewhere you’ll remember as a .vbs file.
Web Analytics