K
kbhavesh
Hi,
I have an exe that i need to call from my C# Program with two
arguments(filenames)
for example
Suppose if i have an application "test.exe" , whose functionality is to
convert a '.doc' file to '.txt' file
On cmd i would normally give the following command as:
test.exe abc.doc xyz.txt
and it works fine and performs its job of conversion.
but what if i want to execute the same thing using my c# code.
i am using the following sample code:
Process compiler = new Process();
compiler.StartInfo.FileName = "test.exe" ;
compiler.StartInfo.Arguments = "abc.doc xyz.txt" ;
compiler.StartInfo.UseShellExecute = false;
compiler.StartInfo.RedirectStandardOutput = true;
compiler.Start();
when i try to invoke the test.exe using the above code , it fails to
perform its operation of conversion.
how is setworking directory to be used?
how should we specify the path for all the files.?
how should we give the path for the above files to be used?
Can anyone tell me if i need to add anything more to the above code
It would be great if somebody could provide some help on the above
topic.
I have an exe that i need to call from my C# Program with two
arguments(filenames)
for example
Suppose if i have an application "test.exe" , whose functionality is to
convert a '.doc' file to '.txt' file
On cmd i would normally give the following command as:
test.exe abc.doc xyz.txt
and it works fine and performs its job of conversion.
but what if i want to execute the same thing using my c# code.
i am using the following sample code:
Process compiler = new Process();
compiler.StartInfo.FileName = "test.exe" ;
compiler.StartInfo.Arguments = "abc.doc xyz.txt" ;
compiler.StartInfo.UseShellExecute = false;
compiler.StartInfo.RedirectStandardOutput = true;
compiler.Start();
when i try to invoke the test.exe using the above code , it fails to
perform its operation of conversion.
how is setworking directory to be used?
how should we specify the path for all the files.?
how should we give the path for the above files to be used?
Can anyone tell me if i need to add anything more to the above code
It would be great if somebody could provide some help on the above
topic.