I need to execute this from within php. This works if I enter it in the command line on windows but I cannot get it to run from php, I tried exec, COM w/WScript.Shell, shell_exec. (running everything on my local computer)

"C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe" /p /h "C:\Documents and Settings\Creative Director\Desktop\pdf\test.pdf"

Has anyone done something like this? Is what I am doing even possible? Could windows be blocking php from doing this action, how could I find out and change it? Any tips?

Thank you for your time,
-Danny

    bike5:

    The issue may lie within the IUSER_ permissions that is on the server.

    If I am not mistaken, it does not directly allow you to execute an application just anywhere on the system.

    Perhaps you can check the permissions of the user (under the IIS Snap-In) to see if they have execute permissions for that folder.

      I am using apache, it is a WAMP installation.

        This works:
        $out = exec('dir');
        echo $out;

        This does not:
        $out = exec('"C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe" /p /h "C:\Documents and Settings\Creative Director\Desktop\pdf\test.pdf"');
        echo $out;

        If that helps any

        Thanks

          have you tried Executing CMD.EXE to run the required app?

          I have heard that it sometimes helps..

            I tried exec('cmd.exe'); before everything and it didn't help. I am not sure if theres a way to exe cmd and then place my text within and exec that? Is there a different way I should try that? -Thanks

              you need to grant access to adobe the same user that apache uses so it can execute it

                What exactly is supposed to be happening when that command is exec'd?

                  Write a Reply...