Question about Process.start

TRHR

New member
Joined
Sep 12, 2005
Messages
1
Programming Experience
Beginner
Hi,

I'm completely new to VB.Net and I'm learning it to develop an open source addon for Windows XP Media Center Edition. My addon is a frontend that utilizies other programs through their command line params. I'm using the Process.start method to control them.

My Question is, how can I change some of the params in process.start control?

i.e Say this is one of the commands controlled by process.start:

VB.NET:
"C:\Program Files\DVRMSToolbox\DVRMStoMPEG.exe" /if=[b]"C:\location\inputfilename.dvr-ms"[/b] /of="C:\output.mpg" /act=dvrmstompg
And I want to be able to change the location and filename of the input file through the gui?

I'm guessing it's through an Arg, but I'm pretty much stumped. If anyone could help or maybe show me some sample code, that'd be great.

Sorry for my complete lack of technical jargon and also if this question has been asked before, but I searched through the forums high and low and couldn't see anything.

Thanks for reading.
 
Try something like this:

VB.NET:
[color=Blue]Dim [/color]str1 [color=Blue]As String[/color] = Chr(34) & "C:\Program Files\DVRMSToolbox\DVRMStoMPEG.exe" & Chr(34) & " /if=" & Chr(34)
[color=Blue]Dim [/color]str2 [color=Blue]As String[/color] = Chr(34) & " /of=" & Chr(34) & "C:\output.mpg" & Chr(34) & " /act=dvrmstompg"
[color=Blue]Dim [/color]dest [color=Blue]As String[/color]
[color=Blue]Dim [/color]process_string [color=Blue]As String[/color]
[color=Blue]Dim [/color]sfd [color=Blue]As New[/color] SaveFileDialog
sfd.Filter = ".dvr-ms|.dvr-ms"
sfd.ShowDialog()
dest = sfd.FileName
[color=Blue]If[/color] dest.Trim <> String.Empty [color=Blue]Then[/color]
	process_string = str1 & dest & str2
	Process.Start(process_string)
[color=Blue]End If[/color]

Hope this helps...
 
the process class doesnt allow the passing of arguements in the same string as the file path but it does take an arguement param right after the file path such as:

Process.Start("C:\Program Files\DVRMSToolbox\DVRMStoMPEG.exe", "/of=" & Chr(34) & "C:\output.mpg" & Chr(34) & " /act=dvrmstompg")
 
Back
Top