Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6475853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:45:17+00:00 2026-05-25T06:45:17+00:00

Hello again Stackoverflow community, Today I am trying to execute an application with commandline

  • 0

Hello again Stackoverflow community,

Today I am trying to execute an application with commandline parameters in C#, that not realy difficult like I tried

Process.Start(foldervar + "cocacola.exe", "pepsi.txt");

Cocacola.exe writes and Log in its current folder. In my commandline I write it manually like this

C:\myfolder>cocacola.exe pepsi.txt

Works wonderful but if I try it in C# a total fail.

I read that C# parses the command as C:\myfolder>cocacola pepsi.txt, without the “.EXE” ending. And I tested it manually without the ending, and this does not work.

Now, my question is what is the correct way to get C# executing it C:\myfolder>cocacola.exe pepsi.txt with the “.EXE”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:45:17+00:00Added an answer on May 25, 2026 at 6:45 am

    use ProcessStartInfo

    http://www.dotnetperls.com/process-start

    example:

        System.Diagnostics.Process proc = new System.Diagnostics.Process();
        proc.WorkingDirectory=@"c:\someplace";
        proc.StartInfo.FileName="cocacola.exe";
        proc.StartInfo.Arguments="pepsi.txt";
        proc.Start();
        proc.WaitForExit();
    

    here is docs on the StartInfo properties:

    http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello again Stackoverflow people! Assume I have these words: smartphones, smartphone I want to
Hello I've runned in to a problem again that I can't solve on my
Hello again stackoverflow... Once again I have a troublesome problem. I have a page
Hello again great knowledge masters of stackoverflow, once again the small coder apprentice tabaluga
Hello again; i need to show X,Y,Risk in ListBoxes. But i can not do
Hello dear members of stackoverflow I've recently started learning C++, today I wrote a
Hello again stackoverflow! So i build this script: <?php $xmlurl = 'http://api.ipinfodb.com/v2/ip_query.php?key=apikey&ip=127.0.0.100&timezone=false'; $xml =
suppose my application posts a status bar notification with the text hello. that hello
Hello again community, I posted a question just over an hour ago asking for
Hello again ladies and gents! OK, following on from my other question on ASP.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.