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 4025256
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:49:25+00:00 2026-05-20T10:49:25+00:00

All I am trying to do is send a command that opens a model

  • 0

All I am trying to do is send a command that opens a model with the program.exe
Supposed to be super simple!

Ex:

"C:\Program Files (x86)\River Logic\Enterprise Optimizer 7.4 Developer\EO74.exe" "C:\PauloXLS\Constraint Sets_1.cor"

The line above works well if pasted on the command prompt window.
However, when trying to pass the same exact string on my code it gets stuck on C:\Program

string EXE = "\"" + @tbx_base_exe.Text.Trim() + "\"";
string Model = "\"" + @mdl_path.Trim()+ "\"";

string ExeModel = EXE + " " + Model;

MessageBox.Show(ExeModel);

ExecuteCommand(ExeModel);

ExeModel is showing te following line on Visual Studio:

"\"C:\\Program Files (x86)\\River Logic\\Enterprise Optimizer 7.4 Developer\\EO74.exe\" \"C:\\PauloXLS\\Constraint Sets_1.cor\""

To me looks like it is the string I need to send in to the following method:

public int ExecuteCommand(string Command)
{
   int ExitCode;
   ProcessStartInfo ProcessInfo;
   Process Process;

   ProcessInfo = new ProcessStartInfo("cmd.exe", "/K " + Command);
   ProcessInfo.CreateNoWindow = true;
   ProcessInfo.UseShellExecute = true;

   Process = Process.Start(ProcessInfo);
   Process.WaitForExit();
   ExitCode = Process.ExitCode;
   Process.Close();

   return ExitCode;
}

Things I’ve tried:

  1. Pass only one command at a time (works as expected), but not an option since the model file will open with another version of the software.
  2. Tried to Trim
  3. Tried with @ with \”

Can anyone see any obvious mistake? Thanks.

  • 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-20T10:49:25+00:00Added an answer on May 20, 2026 at 10:49 am

    Why are you opening a command prompt (cmd.exe)? Just pass the name of the executable.

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

Sidebar

Related Questions

I'm trying to find a way to invoke an interactive command-line program so that
I'm trying to send a WOL package on all interfaces in order to wake
I'm trying to tar up all the *.class files only on a Solaris box
I'm trying to send keystrokes from my C# program to a Java application The
I'm trying to send an email via asp.net mvc2, and all works well on
I am trying to send a simple email through the following code: protected void
All I am trying to do is XmlSerializer serializer = new XmlSerializer(typeof(Stack<int>)); and I
All I am currently trying implement something along the lines of dim l_stuff as
Trying to keep all the presentation stuff in the xhtml on this project and
I'm trying to redirect all requests to my domain to another domain using mod_rewrite

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.