Skip to content

TomaszGrzmilas/CMDHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMDHelper

Simple wrapper for CMD.EXE.

I wanted to run cmd commands and aplications more friendly in C#.

Just make instance of a "CMDHelper.Instance" class and run commands like "process.Run("dir")" it return List, where every line is an list entry.

You can pass arguments with command.

You can set EnvironmentVariable @ constructor.

Usage

static void Main(string[] args)
{
    var process = new CMDHelper.Instance();

    foreach (var item in process.Run("dir"))
    {

        Console.WriteLine(item);
    }
    Console.ReadLine();
}

static void Main(string[] args)
{
    var process = new CMDHelper.Instance(new[] { ("PATH", @"C:\Program Files\dotnet") });

    foreach (var item in process.Run("dotnet --version"))
    {
        Console.WriteLine(item);
    }
    Console.ReadLine();
}

About

Wrapper for CMD.EXE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages