Skip to content

dpryden/ExecuteCommandLineProgram

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overview of the ExecuteCommandLineProgram Library

ExecuteCommandLineProgram is a .NET (4.5) class library for executing command line programs.

The code was copied and slightly modified from this answer to the Stack Overflow question How to capture Shell command output in C#?.

Parts of the code were adapted from a comment by "SeemabK" on Scott Hanselman's blog and other parts are adapted from code written by Daniel Pryden while working at Sonoma Technology, Inc.

Example usage:

CommandLineProgramProcessResult result = CommandLineProgramProcess.RunProgram( @"C:\Program Files (x86)\SomeFolder\SomeProgram.exe", // Path of executable program @"C:\Program Files (x86)\SomeFolder", // Path of working directory String.Format(@"""{0}""", filePathThatNeedsToBeQuotedArgument), // Command line arguments 10 * 60 * 1000); // Timeout, in milliseconds

string standardError = result.StandardError; string standardOutput = result.StandardOutput; int exitCode = result.ExitCode;

About

.NET (4.5) class library for executing a command line program.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%