Recent

Author Topic: Need help with external process  (Read 216 times)

nikel

  • Full Member
  • ***
  • Posts: 123
Need help with external process
« on: October 29, 2020, 11:06:39 am »
Hello, I'm trying to run a program in command line on Windows. This works fine:

Code: Pascal  [Select][+][-]
  1. if RunCommand('ffprobe',['-loglevel error -show_entries format_tags=' + Request +' -of default=noprint_wrappers=1:nokey=1 ' + '"' + Path + '"'], Str) then  begin

But this doesn't set any value:

Code: Pascal  [Select][+][-]
  1. if RunCommand('ffprobe',['"' + Path + '"'], Str) then begin

How can I execute an external command and get the output on Windows?
« Last Edit: October 29, 2020, 11:08:43 am by nikel »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8898
  • FPC developer.
Re: Need help with external process
« Reply #1 on: October 29, 2020, 11:53:31 am »
- No quoting
- pass multiple parameters as a list
   so

RunCommand('ffprobe',['-loglevel','error','-show_entries format',.....

etc

nikel

  • Full Member
  • ***
  • Posts: 123
Re: Need help with external process
« Reply #2 on: October 29, 2020, 04:59:49 pm »
Thanks for the reply.

 

TinyPortal © 2005-2018