Link to home
Start Free TrialLog in
Avatar of zachvaldez
zachvaldezFlag for United States of America

asked on

calling an exe with arguments

How do I run an exe with arguments added at teh end of it.
Im using this

System.Diagnostics.Process.Start("C:\Execute\File_Fixer.exe " & Label9.Text)

with Label9.text having value of "$xps"

In the folder C:\Execute , I have only  File_Fixer.exe .

Is there an approach to carry this out?
Avatar of zachvaldez
zachvaldez
Flag of United States of America image

ASKER

BTW , I get error using it.
SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, that was an excellent article.
What Im trying to do which I did not see how to implement in the article..

In order to accomplish my objective, I need to append command arguments after the exe such that
File_Fixer.exe $xps
because without the extension , I will not get the desired result.

Maybe you can point out where.
sorry but I don't understand what you want. Can you rephrase it? Which error are you getting with your code?
thanks,

Essentially
System.Diagnostics.Process.Start("C:\Execute\File_Fixer.exe", Label9.Text)

is same as

 Dim MyProcess As New Process
            MyProcess.StartInfo.FileName = "File_Fixer.exe"
            MyProcess.StartInfo.WorkingDirectory = "C:\Execute\"
            MyProcess.StartInfo.Arguments = Label9.Text
            MyProcess.Start()
and what is the problem you have with it?
I prefer your process because more options offered.