HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

How to create a (VBS) virus for opening the CD drive automatically.

965 views November 6, 2017 1:20

Watch on YouTube
ChannelArun Surendren

Description from the creator

Code:
do
Dim ts
Dim strDriveLetter
Dim intDriveLetter
Dim fs 'As Scripting.FileSystemObject
Const CDROM = 4
On Error Resume Next
Set fs = CreateObject("Scripting.FileSystemObject")
strDriveLetter = ""
For intDriveLetter = Asc("A") To Asc("Z")
Err.Clear
If fs.GetDrive(Chr(intDriveLetter)).DriveType = CDROM Then
If Err.Number = 0 Then
strDriveLetter = Chr(intDriveLetter)
Exit For
End If
End If
Next
Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection
For d = 0 to colCDROMs.Count - 1
colCDROMs.Item(d).Eject
Next 'null

For d = 0 to colCDROMs.Count - 1
colCDROMs.Item(d).Eject
Next 'null

set owmp = nothing
set colCDROMs = nothing
loop

About this tutorial

Arun Surendren published this 1:20 video tutorial on November 6, 2017. It has been watched 965 times on YouTube.

Duration
1:20
Published
November 6, 2017
Views
965
Likes
14

Share

This tutorial in other languages