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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kimiraikkonen

    #1

    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(B yVal sender As System.Object, ByVal e As
    System.EventArg s) Handles Button1.Click
    System.Diagnost ics.Process.Sta rt("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.

  • Spam Catcher

    #2
    Re: Textbox + Button ? launching command from "cmd.exe&q uot; How?

    kimiraikkonen <kimiraikkonen8 5@gmail.comwrot e in
    news:1185306060 .340880.317240@ q75g2000hsh.goo glegroups.com:
    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
    System.EventArg s) Handles Button1.Click
    System.Diagnost ics.Process.Sta rt("cmd.exe")
    End Sub
    System.Diagnost ics.Process.Sta rt(textbox1.tex t)

    ?

    Comment

    • kimiraikkonen

      #3
      Re: Textbox + Button ? launching command from &quot;cmd.exe&q uot; How?

      On Jul 24, 10:42 pm, Spam Catcher <spamhoney...@r ogers.comwrote:
      kimiraikkonen <kimiraikkone.. .@gmail.comwrot e innews:11853060 60.340880.31724 0@q75g2000hsh.g ooglegroups.com :
      >
      Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
      System.EventArg s) Handles Button1.Click
      System.Diagnost ics.Process.Sta rt("cmd.exe")
      End Sub
      >
      System.Diagnost ics.Process.Sta rt(textbox1.tex t)
      >
      ?
      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...

      Comment

      • kimiraikkonen

        #4
        Re: Textbox + Button ? launching command from &quot;cmd.exe&q uot; How?

        No help?

        Comment

        Working...