PHP and running DOS bat files and capture console

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • IchBin

    PHP and running DOS bat files and capture console

    I have no problem doing this in Java. I am new to PHP. How do you,
    using a PHP script, run a windows DOS.bat file and capture all of its
    console for further processing?

    --
    Thanks in Advance...
    IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
    _______________ _______________ _______________ _______________ ______________

    'If there is one, Knowledge is the "Fountain of Youth"'
    -William E. Taylor, Regular Guy (1952-)
  • ZabMilenko

    #2
    Re: PHP and running DOS bat files and capture console


    Use the backtick operators (next to the 1 key under the ESC key) like so:

    $output = `command.bat`;


    IchBin wrote:
    I have no problem doing this in Java. I am new to PHP. How do you, using
    a PHP script, run a windows DOS.bat file and capture all of its console
    for further processing?
    >

    Comment

    • IchBin

      #3
      Re: PHP and running DOS bat files and capture console

      IchBin wrote:
      I have no problem doing this in Java. I am new to PHP. How do you, using
      a PHP script, run a windows DOS.bat file and capture all of its console
      for further processing?
      >
      Never mind.. Found what I need by using exec(). At least according to
      it's documentation.

      --
      Thanks in Advance...
      IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
      _______________ _______________ _______________ _______________ ______________

      'If there is one, Knowledge is the "Fountain of Youth"'
      -William E. Taylor, Regular Guy (1952-)

      Comment

      Working...