Hi
I am totally new to vb and I saw this script which should open my D drive until I enter the password which is "me" but even when I enter "me" it still opens my drive why?

Thankyou
HLA91

Dim Msg,input,strFlag


Msg = "Who's the man  ?"


strFlag = False

Do While strFlag = False

input = InputBox(strMsg,"Make your selection")

Select Case inp01
    Case "me"
        msgBox "Hell yea"
        strFlag = True
    Case Else
        msgBox "No thats wrong now i wil open your cd rom"
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
End If

End Select

Loop

Wscript.Quit
Member Avatar for rkamin1

It looks like the variable that you are using in your case statement is not the same as the variable where you are storing input, so it always goes to the default case (ie. case else)

Change your Select case statement to Select Case input instead of inp01

That should fix your problem

commented: Very Helpful +1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.