How to pass string to batch file through c# and how batch file will accept string argument? -


my scenario in c# project user pass path "c:\homedir\mydir" batch file batch file should accept path , create directory @ specified path.

i don't know how pass string batch file through c# , how batch file accept string , process it.

create process , pass argument(s) through startinfo.arguments property.

process proc = new process(); proc.startinfo.filename = //path bat file proc.startinfo.arguments = string.format("{0}", @"c:\homedir\mydir"); //set rest of process settings proc.start(); 

that load bat file , pass whichever arguments you've added. bat file can access arguments using %1 first argument, %2 second 1 etc...


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -