Hi all,
To simplify some things I'm trying to automate doing a lot of single (same) commands on a file list.
I normally would have to do something like "startexe parse -v -T filename" for all files in a folder.
My goal is to loop through a filelist and do this command on all files one by one.
I started with a Tprocess to call the main cmd window which is needed, this runs fine.
var
CmdProgram: TProcess;
begin
CmdProgram := TProcess.Create(nil);
try
CmdProgram.CurrentDirectory := edithPath.Text;
CmdProgram.Executable := 'C:\folder\folder\folder\cmd.bat';
CmdProgram.Execute;
finally
CmdProgram.Free;
end;
end;
But now I need to start a command like "command parse -v -T filename" in the cmd window opened by the Tproces from above (a console window cmd.bat opens).
Do I need to start another TProcess for this ? Or is there some of extra function in TProcess that can pass/trigger this line ?
If I add parameters to the CmdProgram like:
CmdProgram.Parameters.Add('command');
CmdProgram.Parameters.Add('parse');
CmdProgram.Parameters.Add('-v');
...
these do not have the correct effect (they do not show up in the created window) I believe they go to the first command -> cmd.bat, or am I passing them in a wrong way ?
Thanks