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?
zachvaldezAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zachvaldezAuthor Commented:
BTW , I get error using it.
0
käµfm³d 👽Commented:
Pass your argument as the second parameter to the Start method:

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

Open in new window


http://msdn.microsoft.com/en-us/library/h6ak8zt5.aspx
0
Éric MoreauSenior .Net ConsultantCommented:
which error?

you should try the arguments property of the process component. check http://emoreau.com/Entries/Articles/2003/12/The-Process-component.aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

zachvaldezAuthor Commented:
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.
0
Éric MoreauSenior .Net ConsultantCommented:
sorry but I don't understand what you want. Can you rephrase it? Which error are you getting with your code?
0
zachvaldezAuthor Commented:
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()
0
Éric MoreauSenior .Net ConsultantCommented:
and what is the problem you have with it?
0
zachvaldezAuthor Commented:
I prefer your process because more options offered.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.