Play with VB Code

Just some visual basic scripts
open notepad (or wordpad) paste this code in it.
Now save file extension as .vbs  (ie) type this name.vbs
the extention vbs is required it then open it and ur result we’ll be cool  😀

message box:
Code:
msgbox “Hai Johnkrish UR AMAZING!!!”

Other message box with ur own title
Code:
X = msgbox (“Johnkrish the great”, 1024, “jkdgreat.wordpress.com”)

An Input
Code:
a=inputbox(“What’s Your Name?”)
msgbox “What a Cool name man,” +a

Another Input
Code:
strPtn = InputBox(“What’s your age?”)
If (strptn) > 17 Then: msgbox “Your age is above 17 !!”
do
If (strPtn) < 18 Then: strPtn = InputBox(“Your age is below 18 !!”)
loop
msgbox “jkdgreat”

SystemBeep
Code:
Set oWS = WScript.CreateObject(“WScript.Shell”)
oWS.Run “%comspec% /c echo ” & Chr(07), 0, True

CD / DVD Box opens
Code:
Set oWMP = CreateObject(“WMPlayer.OCX.7” )
Set colCDROMs = oWMP.cdromCollection
colCDROMs.Item(i).Eject

CD / DVD Box Open and Close
Code:
Dim oWMP
Dim colCDROMs, i
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
For i = 0 to colCDROMs.Count – 1
colCDROMs.Item(i).Eject
Next
End If
oWMP.close
Set colCDROMs = Nothing
Set oWMP = Nothing

Advertisements

,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: