0

I am trying to run a SteamCMD command with delphi. What I want to do is is to put the command in a TEdit and retrieve the output in a TMemo. I have tried finding a log file in steamcmd that outputs everything but cannot find it. What I tried doing was

procedure Tfrmmain.runcommandClick(Sender: TObject);
var
  command : String;
begin
  command := edtcommand.Text;
  ShellExecute(0, nil, 'steamcmd/steamcmd.exe', PChar('/c ' + command), nil, SW_HIDE);
  Sleep(1000);
  memoutput.Lines.LoadFromFile('output.txt');
end;

The SteamCMD.exe file is in a subfolder in the project folder.

But as you know there is no output file that I could find to load from. Is there anyway I can do this?

This is the design of the Form if it helps to understand.

enter image description here

Adriaan
  • 254
  • 3
  • 11
  • Doesn't look like this has anything to do with steam per se. You want to pipe input to a process, and capture the output. Right? That's a topic that has been covered here countless times. – David Heffernan Sep 15 '16 at 14:50
  • Do you think you can direct me to a post where to one of the topics that you can recommend? – Adriaan Sep 15 '16 at 15:00
  • there are tons of examples on this site, here is one to get you started: http://stackoverflow.com/a/9120103/800214 – whosrdaddy Sep 15 '16 at 15:02
  • @whosrdaddy Without wanting to sound arrogant, the dupe has better content – David Heffernan Sep 15 '16 at 15:03
  • @DavidHeffernan: fair enough :) – whosrdaddy Sep 15 '16 at 15:05
  • Its fine. As you said there is other posts like this I just didn't know about the pipe input thing. I'm Learning Delphi in school and they don't teach us this sort of stuff. I am expanding my knowledge. – Adriaan Sep 15 '16 at 15:08

0 Answers0