Muti-parameter for System.diagnostics.process.start() ???

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

    #1

    Muti-parameter for System.diagnostics.process.start() ???

    Hello,
    I want to ask this:

    If i do: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
    standard c:\blabla.wav c:\blabla.mp3") it works.

    But i don't want this. I want my 2 textboxes must take place as
    variable like: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
    standard textbox1" textbox1.text +
    textbox2.text). But that doesn't work. Meanwhile textboxes are the
    filename paths.

    How can i run my process with more than one parameter using user
    variables like placed in textboxes?

    Very thanks.

  • Andrew Jackson

    #2
    Re: Muti-parameter for System.diagnost ics.process.sta rt() ???

    Looks to me you forgot one of your str concats

    System.Diagnost ics.Process.Sta rt("c:\lame","--preset
    standard"+textb ox1.text+" "+textbox2.text )

    "kimiraikko nen" <kimiraikkonen8 5@gmail.comwrot e in message
    news:1191190770 .293868.285410@ r29g2000hsg.goo glegroups.com.. .
    Hello,
    I want to ask this:
    >
    If i do: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
    standard c:\blabla.wav c:\blabla.mp3") it works.
    >
    But i don't want this. I want my 2 textboxes must take place as
    variable like: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
    standard textbox1" textbox1.text +
    textbox2.text). But that doesn't work. Meanwhile textboxes are the
    filename paths.
    >
    How can i run my process with more than one parameter using user
    variables like placed in textboxes?
    >
    Very thanks.
    >

    Comment

    • Andrew Jackson

      #3
      Re: Muti-parameter for System.diagnost ics.process.sta rt() ???

      Mybad you also probably need to put a space after standard in my reply
      below.

      System.Diagnost ics.Process.Sta rt("c:\lame","--preset standard
      "+textbox1.text +" "+textbox2.text )

      "Andrew Jackson" <no email specifiedwrote in message
      news:AqCdnekzF7 2p353anZ2dnUVZ_ uidnZ2d@giganew s.com...
      Looks to me you forgot one of your str concats
      >
      System.Diagnost ics.Process.Sta rt("c:\lame","--preset
      standard"+textb ox1.text+" "+textbox2.text )
      >
      "kimiraikko nen" <kimiraikkonen8 5@gmail.comwrot e in message
      news:1191190770 .293868.285410@ r29g2000hsg.goo glegroups.com.. .
      >Hello,
      >I want to ask this:
      >>
      >If i do: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
      >standard c:\blabla.wav c:\blabla.mp3") it works.
      >>
      >But i don't want this. I want my 2 textboxes must take place as
      >variable like: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
      >standard textbox1" textbox1.text +
      >textbox2.text) . But that doesn't work. Meanwhile textboxes are the
      >filename paths.
      >>
      >How can i run my process with more than one parameter using user
      >variables like placed in textboxes?
      >>
      >Very thanks.
      >>
      >
      >

      Comment

      • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

        #4
        RE: Muti-parameter for System.diagnost ics.process.sta rt() ???

        This should work:

        System.Diagnost ics.Process.Sta rt("c:\lame", _
        "--preset standard textbox1" + textbox1.text + textbox2.text).

        You were missing one plus sign. If you copied wrong and actually had the
        plus sign, then it should have worked. You may need to quote some of the
        strings, if they contain spaces. Spaces are assumed to separate the
        arguments, so quoting it will allow for a space in an argument.

        Hope this helps.

        "kimiraikko nen" wrote:
        Hello,
        I want to ask this:
        >
        If i do: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
        standard c:\blabla.wav c:\blabla.mp3") it works.
        >
        But i don't want this. I want my 2 textboxes must take place as
        variable like: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
        standard textbox1" textbox1.text +
        textbox2.text). But that doesn't work. Meanwhile textboxes are the
        filename paths.
        >
        How can i run my process with more than one parameter using user
        variables like placed in textboxes?
        >
        Very thanks.
        >
        >

        Comment

        • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

          #5
          RE: Muti-parameter for System.diagnost ics.process.sta rt() ???

          Andrew is correct, that there should be a + " " + between the two textbox
          items.


          "Family Tree Mike" wrote:
          This should work:
          >
          System.Diagnost ics.Process.Sta rt("c:\lame", _
          "--preset standard textbox1" + textbox1.text + textbox2.text).
          >
          You were missing one plus sign. If you copied wrong and actually had the
          plus sign, then it should have worked. You may need to quote some of the
          strings, if they contain spaces. Spaces are assumed to separate the
          arguments, so quoting it will allow for a space in an argument.
          >
          Hope this helps.
          >
          "kimiraikko nen" wrote:
          >
          Hello,
          I want to ask this:

          If i do: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
          standard c:\blabla.wav c:\blabla.mp3") it works.

          But i don't want this. I want my 2 textboxes must take place as
          variable like: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
          standard textbox1" textbox1.text +
          textbox2.text). But that doesn't work. Meanwhile textboxes are the
          filename paths.

          How can i run my process with more than one parameter using user
          variables like placed in textboxes?

          Very thanks.

          Comment

          • rowe_newsgroups

            #6
            Re: Muti-parameter for System.diagnost ics.process.sta rt() ???

            On Sep 30, 9:10 pm, Family Tree Mike
            <FamilyTreeM... @discussions.mi crosoft.comwrot e:
            Andrew is correct, that there should be a + " " + between the two textbox
            items.
            >
            "Family Tree Mike" wrote:
            This should work:
            >
            System.Diagnost ics.Process.Sta rt("c:\lame", _
            "--preset standard textbox1" + textbox1.text + textbox2.text).
            >
            You were missing one plus sign. If you copied wrong and actually had the
            plus sign, then it should have worked. You may need to quote some of the
            strings, if they contain spaces. Spaces are assumed to separate the
            arguments, so quoting it will allow for a space in an argument.
            >
            Hope this helps.
            >
            "kimiraikko nen" wrote:
            >
            Hello,
            I want to ask this:
            >
            If i do: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
            standard c:\blabla.wav c:\blabla.mp3") it works.
            >
            But i don't want this. I want my 2 textboxes must take place as
            variable like: System.Diagnost ics.Process.Sta rt("c:\lame", "--preset
            standard textbox1" textbox1.text +
            textbox2.text). But that doesn't work. Meanwhile textboxes are the
            filename paths.
            >
            How can i run my process with more than one parameter using user
            variables like placed in textboxes?
            >
            Very thanks.
            For hard to read concatenations, I tend to use the String.Format()
            option:

            Process.Start(" C:\lame", _
            String.Format("--preset standard {0} {1}", textBox1.Text,
            textBox2.Text))

            (imo) It makes spacing and other concerns much easier to look at.

            Thanks,

            Seth Rowe

            Comment

            • kimiraikkonen

              #7
              Re: Muti-parameter for System.diagnost ics.process.sta rt() ???

              Thanks all :) Multi-parameter launch is OK now but i couldn't hide my
              process while processing. It's still shown on the screen.

              Dim myProcess As System.Diagnost ics.Process = New
              System.Diagnost ics.Process()
              myProcess.Start Info.WindowStyl e =
              System.Diagnost ics.ProcessWind owStyle.Hidden
              myProcess = System.Diagnost ics.Process.Sta rt("c:\lame",
              "--preset standard" + textbox1.text + " " +
              textbox2.text).
              myProcess.WaitF orExit()
              MsgBox("Convers ion Completed Successfully",
              MsgBoxStyle.Inf ormation, "Completed" )

              Comment

              Working...