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

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

P: n/a
Hello,
I want to ask this:

If i do: System.Diagnostics.Process.Start("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.Diagnostics.Process.Start("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.

Sep 30 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Looks to me you forgot one of your str concats

System.Diagnostics.Process.Start("c:\lame","--preset
standard"+textbox1.text+" "+textbox2.text)

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:11**********************@r29g2000hsg.googlegr oups.com...
Hello,
I want to ask this:

If i do: System.Diagnostics.Process.Start("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.Diagnostics.Process.Start("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.

Oct 1 '07 #2

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

System.Diagnostics.Process.Start("c:\lame","--preset standard
"+textbox1.text+" "+textbox2.text)

"Andrew Jackson" <no email specifiedwrote in message
news:Aq******************************@giganews.com ...
Looks to me you forgot one of your str concats

System.Diagnostics.Process.Start("c:\lame","--preset
standard"+textbox1.text+" "+textbox2.text)

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:11**********************@r29g2000hsg.googlegr oups.com...
>Hello,
I want to ask this:

If i do: System.Diagnostics.Process.Start("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.Diagnostics.Process.Start("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.


Oct 1 '07 #3

P: n/a
This should work:

System.Diagnostics.Process.Start("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.

"kimiraikkonen" wrote:
Hello,
I want to ask this:

If i do: System.Diagnostics.Process.Start("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.Diagnostics.Process.Start("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.

Oct 1 '07 #4

P: n/a
Andrew is correct, that there should be a + " " + between the two textbox
items.
"Family Tree Mike" wrote:
This should work:

System.Diagnostics.Process.Start("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.

"kimiraikkonen" wrote:
Hello,
I want to ask this:

If i do: System.Diagnostics.Process.Start("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.Diagnostics.Process.Start("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.
Oct 1 '07 #5

P: n/a
On Sep 30, 9:10 pm, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
Andrew is correct, that there should be a + " " + between the two textbox
items.

"Family Tree Mike" wrote:
This should work:
System.Diagnostics.Process.Start("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.
"kimiraikkonen" wrote:
Hello,
I want to ask this:
If i do: System.Diagnostics.Process.Start("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.Diagnostics.Process.Start("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

Oct 1 '07 #6

P: n/a
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.Diagnostics.Process = New
System.Diagnostics.Process()
myProcess.StartInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Hidden
myProcess = System.Diagnostics.Process.Start("c:\lame",
"--preset standard" + textbox1.text + " " +
textbox2.text).
myProcess.WaitForExit()
MsgBox("Conversion Completed Successfully",
MsgBoxStyle.Information, "Completed")

Oct 1 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.