Executing command line from windows application

Posted by aron on Stack Overflow See other posts from Stack Overflow or by aron
Published on 2010-05-11T18:50:01Z Indexed on 2010/05/11 18:54 UTC
Read the original article Hit count: 203

Filed under:
|
|

Hello,

i need to execute command line from .NET windows application. I tried with this code but i get error

'C:\Documents' is not recognized as an internal or external command, operable program or batch file.

        var command ="\"C:\\Documents and Settings\\Administrator\\My Documents\\test.exe\" \"D:\\abc.pdf\" \"C:\\Documents and Settings\\Administrator\\My Documents\\def.pdf\"";
        var processInfo = new ProcessStartInfo("cmd","/c " + command)
                              {
                                  UseShellExecute = false,
                                  RedirectStandardError = true,
                                  CreateNoWindow = true
                              };
        var p = Process.Start(processInfo);

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET