By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,838 Members | 1,675 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,838 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.

Jul 24 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
kimiraikkonen <ki*************@gmail.comwrote in
news:11**********************@q75g2000hsh.googlegr oups.com:
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)

?
Jul 24 '07 #2

P: n/a
On Jul 24, 10:42 pm, Spam Catcher <spamhoney...@rogers.comwrote:
kimiraikkonen <kimiraikkone...@gmail.comwrote innews:11**********************@q75g2000hsh.google groups.com:
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)

?
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...

Jul 24 '07 #3

P: n/a
No help?

Jul 25 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.