Execute a Network command

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

    Execute a Network command

    Hello,

    I'm trying to execute an Network command with PHP exec() function but
    i can't.
    The PHP script looks like the following:

    <?php
    ...
    exec('\\PTtype\ Myapp');
    ...
    ?>

    When i execute this command in the windows shell i've no problem, but
    when i use PHP exec() function it simply don't run. It seems that the
    instruction is jumped.
    I guess it isn't a PHP problem because when i make:

    <?php
    ...
    exec('C:\\WINDO WS\\NOTEPAD:EXE ');
    ...
    ?>

    NOTEPAD is correctly opened.

    Probably the problem has to do with the way the 'Path' is typed.

    Any HELP please?

    Thanks.
    Regards,
    Miguel
  • Pedro Graca

    #2
    Re: Execute a Network command

    Miguel wrote:[color=blue]
    > I'm trying to execute an Network command with PHP exec() function but
    > i can't.
    > The PHP script looks like the following:
    >
    > <?php
    > ...
    > exec('\\PTtype\ Myapp');
    > ...
    > ?>[/color]
    (snip)[color=blue]
    > Probably the problem has to do with the way the 'Path' is typed.
    >
    > Any HELP please?[/color]

    Maybe you have to start a command interpreter ???

    exec('cmd /c \\PTtype\Myapp' );


    Also try a

    exec('cmd /c "set > c:\\setdata.txt "');

    and check the contents of the new file to verify what user php runs
    under and if it has access to the network directory.


    HTH

    --
    USENET would be a better place if everybody read: : mail address :
    http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
    http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
    http://www.expita.com/nomime.html : to 10K bytes :

    Comment

    Working...