after executing system(), how can I pass "Y" to system by php?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jiing.deng@gmail.com

    after executing system(), how can I pass "Y" to system by php?

    I want to use the system command to set user's priority

    $cmd = "cacls d:\\appserv\\ww w\\accountMng\\ $userName /G $userName:F";
    system($cmd);

    Then it appears
    Are you sure (Y/N)?

    How can I pass the "Y" to system by php?

    Thanks in advance.
    -jiing-

  • Colin McKinnon

    #2
    Re: after executing system(), how can I pass "Y&quot ; to system by php?

    jiing.deng@gmai l.com wrote:
    [color=blue]
    > I want to use the system command to set user's priority
    >
    > $cmd = "cacls d:\\appserv\\ww w\\accountMng\\ $userName /G $userName:F";
    > system($cmd);
    >
    > Then it appears
    > Are you sure (Y/N)?
    >
    > How can I pass the "Y" to system by php?
    >
    > Thanks in advance.
    > -jiing-[/color]

    Use proc_open instead.

    It's been a while since I had to dirty my hands on a Microsoft machine, and
    I've never used 'cacls' but IME most MS CLI commands have a switch for
    running non-interactively.

    HTH

    C.

    Comment

    • Steve

      #3
      Re: after executing system(), how can I pass "Y&quot ; to system by php?


      $cmd =
      "ECHO Y | cacls d:\\appserv\\ww w\\accountMng\\ $userName /G
      $userName:F";

      ---
      Steve

      Comment

      • jiing.deng@gmail.com

        #4
        Re: after executing system(), how can I pass "Y&quot ; to system by php?

        thank you :p
        Steve wrote:[color=blue]
        > $cmd =
        > "ECHO Y | cacls d:\\appserv\\ww w\\accountMng\\ $userName /G
        > $userName:F";
        >
        > ---
        > Steve[/color]

        Comment

        Working...