TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
D Sk
NA
9
1.2k
calling another exe from my c#code
Jul 26 2017 4:15 AM
Hi all,
I have an exe MCP2210CLI placed at
C:\Users\testuser\Desktop
. I cannot run it directly by double clicking on it. So I use command prompt and execute the following.
C:\Users\testuser>cd desktop
C:\Users\testuser\Desktop>MCP2210CLI -devices
No devices connected.
I want to do these tasks in my c# code and generate the output in a command prompt.
I have written the following code. Howevwe an empty command prompt window opens. What change is needed in my code to get the exe running?
Process myProcess = new Process();
try
{
myProcess.StartInfo.FileName = @"C:\Users\testuser\Desktop\MCP2210CLI.exe";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.StartInfo.Arguments = "-devices";
myProcess.Start();
myProcess.WaitForExit();
}
catch (Exception e)
{
Console.WriteLine("error",e.Message);
}
Thanks in advance.
Reply
Answers (
1
)
Understand repository functions
Creation of MSI Package from EXE using VS 2017 C#