1) Try edit your bat/cmd for receive arguments thought in C#:
2) You need edit your bat/cmd to receive your C# arguments:
Here is sample c# code that are sending 2 arguments to a bat/cmd file
using System;
using System.Diagnostics;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
System.Diagnostics.Process.Start(@"c:\batchfilename.bat", "\"1st\" \"2nd\"");
}
}
}
Obs.: c# sources from @T.S.Sathish answer here
- The bat file code using %1 & %2 arguments passed from C #:
@echo off
%__APPDIR__%mode.com con: cols=60 lines=6
echo/
echo/ your arg_CS[0] == arg_bat[%%1] == %1
echo/ your arg_CS[1] == arg_bat[%%2] == %2
echo/ ________________________________________________________
echo/ Please, press any key for me got to go drink a coffe...
@%__APPDIR__%timeout.exe -1 >nul

Option 2 : Hiding the console window, passing arguments and taking outputs
using System;
using System.Diagnostics;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
var process = new Process();
var startinfo = new ProcessStartInfo(@"c:\batchfilename.bat", "\"1st_arg\" \"2nd_arg\" \"3rd_arg\"");
startinfo.RedirectStandardOutput = true;
startinfo.UseShellExecute = false;
process.StartInfo = startinfo;
process.OutputDataReceived += (sender, argsx) => Console.WriteLine(argsx.Data); // do whatever processing you need to do in this handler
process.Start();
process.BeginOutputReadLine();
process.WaitForExit();
}
}
}
This is based on my limited understanding of English so if that is not correct, sorry, and if possible, please let me know ...