Textbox + Button ? launching command from "cmd.exe" How?

K

kimiraikkonen

Hi experts,
I just want to ask a simple procedure of my simple form. My form has a
input textbox and a button.

I want this if you can help me:

Application user types a command prompt command like "dir" into
"textbox", then after clicking "button", command prompt(cmd) should
run with the prompt that user has written already into "textbox" .

I managed to run command prompt with this code, but the problem is how
to use command prompt with textbox+button?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
System.Diagnostics.Process.Start("cmd.exe")
End Sub

For example user enters "dir" into textbox, then clicks "button" after
that command prompt is opened and lists file of the current directory?

How to implement this?

Also if you explain how to use command with parameters like "dir /a"
in VB.NET?

Very thanks.
 
G

Guest

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
System.Diagnostics.Process.Start("cmd.exe")
End Sub

System.Diagnostics.Process.Start(textbox1.text)

?
 
K

kimiraikkonen

System.Diagnostics.Process.Start(textbox1.text)

?

What? Why is NOT my first message displayed? Sth weird on the
groups...

I just wanted to ask how to launch cmd (command prompt) with "dir"
command also with parameters...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top