(Delphi)如何使用DosCommand组件?

时间:2017-01-14 16:20:26

标签: delphi delphi-10.1-berlin

我在Rad Studio Berlin 10 update 2上安装了last-in-first-out (LIFO) manner,但我无法找到如何使用它。我试过玩它,我搜索了谷歌寻找的例子,但我找不到。

1 个答案:

答案 0 :(得分:1)

很遗憾,您的问题没有详细说明。 如果已成功安装组件,则它应显示在组件选项板中。请将其放在表单上,​​在对象检查器中调整属性并调用Execute

BTW你读过"如何使用它"和"示例"单位标题中的评论?

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

实施例

  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;