472,146 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

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

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
3 4962
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
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
No help?

Jul 25 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by marco | last post: by
3 posts views Thread by Graham Mattingley | last post: by
reply views Thread by uballing | last post: by
reply views Thread by Saiars | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.