(Delphi) How to use DosCommand Component? [closed]

2019-09-19 20:10发布

问题:

I have Installed https://github.com/TurboPack/DOSCommand on Rad Studio Berlin 10 update 2 but I cannot find out how to use it. I have tried playing around with it and I have searched through google looking for examples but I can't find any.

回答1:

Unfortunately your question does not have a detailed description. If you have the component installed successfully it should appear in the component palette. Please place it on your form, adjust properties in object inspector and call Execute.

BTW have you read "How to use it" and "Example" comments in the unit header?

 *******************************************************************
  How to use it :
  ---------------
  - just put the line of command in the property 'CommandLine'
  - execute the process with the method 'Execute'

Example

  Example : Make a dir :
  ----------------------
  - if you want to get the Result of a 'c:\dir /o:gen /l c:\windows\*.txt'
  for example, you need to make a batch file
  --the batch file : c:\mydir.bat
  @echo off
  dir /o:gen /l %1
  rem eof
  --in your code
  DosCommand.CommandLine := 'c:\mydir.bat c:\windows\*.txt';
  DosCommand.Execute;