C# Win Forms でこれに取り組んでいます。
どのように変数を設定し、その後コマンド copy を実行しますか? コードが現在のように、Process1.startInfo.Arguments = "/k SET etc. etc." 「/k COPY etc. etc」によって上書きされます。コマンドとそこには実行されません。
public void OutputBtn_Process_Click(object sender, EventArgs e)
{
foreach (FileInfo fi in listBox1.Items)
{
Process process1 = new Process();
process1.StartInfo.Arguments ="/k Set filename ="+fi.Name;
process1.StartInfo.UseShellExecute = false;
process1.StartInfo.Arguments = "/k copy /b %filename% test.txt";
//process1.StartInfo.LoadUserProfile = true;
process1.StartInfo.FileName = "cmd.exe";
process1.StartInfo.WorkingDirectory = Path.GetDirectoryName(fi.FullName);
process1.Start();
}
}