I have vb app that calls another vb app using Process.Start(PROGRAM). My question is how can I pass a parameter to the PROGRAM and how can I intercept it in the PROGRAM?
2 Answers
Use the ProcessStartInfo class and set the FileName property to the name of the VB app, then set the Arguments property to the arguments.Assign the property StartInfo of the Process class to the instance of ProcessStartInfo and you're good to go.
From the other VB application use Args parameter of the Main class which is of a string array to process the arguments.
Hope this helps, Best regards, Tom.
2 Comments
Alex
>>>Arguments Property... What/where is this? from here on I'm lost
t0mm13b
@bochur1: Arguments is a property of ProcessStartInfo class in which you instantiate. Dim ps As New ProcessStartInfo() ps.FileName = "name_of_exe" ps.Arguments = "exe_arguments" Dim proc As New Process() proc.StartInfo = ps proc.Start
Startand then pressingF1. There you find samples how to use theStartmethod and information on what overloads are available.