Math chiller
Math chiller

Reputation: 4167

entering a cmd command with button click

im kinda a vba nub, and i am trying to launch Firefox with a button click based on this video (which is for visual-studio-2008) using the following code

Private Sub Button1_Click() Handles Button1.Click
    Shell("CMD.exe")
    SendKeys.Send("start firefox")
    SendKeys.Send("{ENTER}")
    Close()
End Sub

however, all this does is launches cmd, it doesnt enter anything in it (when i type start firefox into cmd it works), what am i doing wrong?

note: i am using visual-studio-2012 (if it matters), and i have never used cmd before in a visual basic program.

Upvotes: 0

Views: 4202

Answers (1)

S.Serpooshan
S.Serpooshan

Reputation: 8388

Shell("CMD.exe /C start firefox")

Upvotes: 1

Related Questions