0

I have a .exe program which has it's own commands. This program needs to be executed through CMD (command prompt , MS DOS). It works like this: Let's say that I have a project in visual Studio and I've imported the .exe program (which name is ul_install.exe) in the project.

First of all, how can I invoke CMD, then change directory into the .exe program i've already imported into my project and then pass this: ul_install E A "Example" DVD command as a string variable (As if I had written it) and finally press Enter? Keep in Mind that whenever I do this manually another cmd windows appears which is the process of the .exe program and start to make it's process (Which is converting an ISO file into another split files format)

TLo
  • 11
  • 3
  • 1
    Please format this into multiple sentences and paragraphs so people don't get a headache trying to figure out what you're asking. – rory.ap Feb 28 '17 at 15:38
  • Why do you think the command prompt part is a necessary part of the process here? Why do you think you cannot launch the exe directly? – Damien_The_Unbeliever Feb 28 '17 at 15:38
  • Why don't just start ul_install.exe directly using Process.Start and in the StartInfo put the paremeters and specify the CurrentDirectory where the program will start? – dcg Feb 28 '17 at 15:39
  • 2
    http://stackoverflow.com/questions/1469764/run-command-prompt-commands This may help you. It states how to start the command prompt shell from C#... which may be what you need or want? – DDelgro Feb 28 '17 at 15:47
  • Possible duplicate of [Run Command Prompt Commands](http://stackoverflow.com/questions/1469764/run-command-prompt-commands) – Cleptus Feb 28 '17 at 15:55
  • Possible duplicate of [Execute the C# console exe with command line arguments from VB Project](http://stackoverflow.com/questions/42167089/execute-the-c-sharp-console-exe-with-command-line-arguments-from-vb-project) – blaze_125 Feb 28 '17 at 16:01
  • Damien I can't run the .exe directly cause it closes instantly the only way is opening cmd cd to the .exe path and passing the commands I've write which only the .exe interprets – TLo Feb 28 '17 at 16:13

1 Answers1

0

The answer I was looking was using ProcessStartInfo.WorkingDirectoryusing this property and passing a string I can make the cmd.exe invoke in the the directory I wanted then I could pass this argument: ul_install E A "Example" DVDand make my program working :-)

TLo
  • 11
  • 3