This is a cool script in VBS by which you can continuously or once eject out your CD-ROM by just one click.
This is also called a CD-ROM virus.
To do these perform these steps:-
1.open notepad
2.Type the below code in notepad and save it as anyname.vbs and just double-click the file to see magic.
[sourcecode language="vb"]
Set cdrom=Createobject("WMPlayer.OCX.7")
Set cd=cdrom.cdromcollection
if cd.Count>=1 then
For i=0 to cd.Count-1
cd.Item(i).Eject
Next ' cdrom
End if
[/sourcecode]
The above code can eject multiple Cd-ROM but if you have only one try the below code:-
[sourcecode language="vb"]
Set cdrom=Createobject("WMPlayer.OCX.7")
Set cd=cdrom.cdromcollection
cd.Item(0).Eject
[/sourcecode]
EXPLANATION
The Set cdrom & Set cd makes two variables namely cdrom and cd.
The Createobject("WMPlayer.OCX.7") is a function which creates object of type Windows media player.
In the code Set cd=cdrom.cdromcollection the cdromcollection is an object that is able to control a collection of CD and DVD and count is the property of it.
NOTE:-Some anti-virus may consider it as a virus and give warning but don't panic.
Also whenever you double-click the file a process "wscript.exe" is released , to end it open task manager short-cut ALT+CTRL+DELETE goto processes tab and find wscript.exe process select it and select end process at bottom-right.



0 comments:
Post a Comment