
Its really funny to see how your friends CD-Drive being ejected every now and then, and they are unable to find out whats going on! Here I will provide code of a small program that will make it possible.
- Open Notepad(Start > All Programs > Accessories > Notepad).
- Copy the following code and paste it in Notepad:
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
do
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count-1
colCDROMs.Item(i).Eject
Next
For i = 0 to colCDROMs.Count-1
colCDROMs.Item(i).Eject
Next
End If
wscript.sleep 5000
loop
- Save the file with a .vbs extension. For example: Eject.vbs. See Saving Files in VBScript for details.
- Now Open the Eject.vbs file. This will make the tray of the CD-Drive to eject continuously.
How to Stop it:
- Open Task Manager (Right-click on taskbar > select Task Manager).
- Click on Processes tab.
- Scroll down to the end. End the process wscript.exe. (You may require an administrator privilege).
6. To create an automated search in Google Chrome through Notepad.
This script will launch Google Chrome and do an automated search in it:
- Open Notepad(Start > All Programs > Accessories > Notepad).
- Copy the following code and paste it in Notepad:
set wshshell = wscript.CreateObject("wscript.shell")
wshshell.run "chrome.exe"
wscript.sleep 5000
wshshell.AppActivate "firefox.exe"
WshShell.SendKeys "w"
WScript.Sleep 500
WshShell.SendKeys "32"
WScript.Sleep 500
WshShell.SendKeys "."
WScript.Sleep 500
WshShell.SendKeys "S"
WScript.Sleep 500
WshShell.SendKeys "a"
WScript.Sleep 500
WshShell.SendKeys "l"
WScript.Sleep 500
WshShell.SendKeys "i"
WScript.Sleep 500
WshShell.SendKeys "t"
WScript.Sleep 500
WshShell.SendKeys "y"
WScript.Sleep 500
WshShell.SendKeys "."
WScript.Sleep 500
WshShell.SendKeys "r"
WScript.Sleep 500
WshShell.SendKeys ""
WScript.Sleep 500
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
wshshell.run "chrome.exe"
wscript.sleep 5000
wshshell.AppActivate "firefox.exe"
WshShell.SendKeys "w"
WScript.Sleep 500
WshShell.SendKeys "32"
WScript.Sleep 500
WshShell.SendKeys "."
WScript.Sleep 500
WshShell.SendKeys "S"
WScript.Sleep 500
WshShell.SendKeys "a"
WScript.Sleep 500
WshShell.SendKeys "l"
WScript.Sleep 500
WshShell.SendKeys "i"
WScript.Sleep 500
WshShell.SendKeys "t"
WScript.Sleep 500
WshShell.SendKeys "y"
WScript.Sleep 500
WshShell.SendKeys "."
WScript.Sleep 500
WshShell.SendKeys "r"
WScript.Sleep 500
WshShell.SendKeys ""
WScript.Sleep 500
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
- Save the file with a .vbs extension. For example: Search.vbs. See Saving Files in VBScript for details.
- Now Open the Search.vbs file. This will create an automated search in Chrome.
7. How to launch any VBScript on Windows Startup
Copy the Script file and paste it to the windows Startup Folder
Now your VBScript is added to the windows startup and whenever the system is started this will execute automatically. In fact you can add any application in this folder to launch it at Windows Startup.
- For Windows 7/Vista: Click on Start > All Programs > Startup
- For XP: Navigate to this folder C:(system drive)\Documents and Settings\"YOUR USER NAME"\Start Menu\Programs\Startup
Now your VBScript is added to the windows startup and whenever the system is started this will execute automatically. In fact you can add any application in this folder to launch it at Windows Startup.





















1 comments:
A person necessarily help to make critically articles I would state.
This is the first time I frequented your web page and thus far?
I surprised with the research you made to make this actual
post amazing. Fantastic task!
Also visit my site ... pdf password remover
Post a Comment
Your feedback is always appreciated. We will try to reply to your queries as soon as time allows.
Please do not spam Spam comments will be deleted immediately upon our review.
Click on the 'subscribe by email' option to get notified for further replies.