What is the difference between raw cmd execute on server, and executing by Apache/PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • joe1977@tlen.pl

    What is the difference between raw cmd execute on server, and executing by Apache/PHP

    Win2k3, PHP 5, Apache 2, Acrobat 7

    when I go to my server, pull out cmd.exe and type as follows:

    "c:\Program Files\Adobe\Acr obat 7.0\\Reader\Acr oRd32.exe" /t
    "c:\Program Files\Adobe\Acr obat 7.0\Reader\test .pdf" "labelprint er"


    the document test.pdf will be printed on labelprinter. Now,
    labelprinter is set for non-default draw "Casette nr 2" and the line
    above print it out the way it supposed to be - to the "Casette 2"

    when I do something like this by PHP:

    $link = "\"c:\\Prog ram Files\\Adobe\\A crobat
    7.0\\Reader\\Ac roRd32.exe\" /t \"c:\\Progra m Files\\Adobe\\A crobat
    7.0\\Reader\\te st.pdf\" \"labelprinter\ "";

    and try to execute it either with exec, shell_exec or $WshShell->Run
    from WScript.Shell object, it printing test.pdf but it does not use
    non-default already set "Casette 2". The page is still printed on
    "Casette 1".

    Where is the problem? I would say with printer or Adobe, but when I go
    by cmd.exe on the server, it is printed out properly "Casette 2", but
    when I try to execute by PHP using the same batch script line, it
    stills go to the wrong Casette 1.


    Did for anyone this issue sound familiar?



    Any help will be greatfull :)

  • Xristos Nikolopoulos

    #2
    Re: What is the difference between raw cmd execute on server, and executing by Apache/PHP

    try to generate by php a .bat file, execute it, and then delete the .bat
    file


    <joe1977@tlen.p l> wrote in message
    news:1142621014 .626458.183670@ j33g2000cwa.goo glegroups.com.. .[color=blue]
    > Win2k3, PHP 5, Apache 2, Acrobat 7
    >
    > when I go to my server, pull out cmd.exe and type as follows:
    >
    > "c:\Program Files\Adobe\Acr obat 7.0\\Reader\Acr oRd32.exe" /t
    > "c:\Program Files\Adobe\Acr obat 7.0\Reader\test .pdf" "labelprint er"
    >
    >
    > the document test.pdf will be printed on labelprinter. Now,
    > labelprinter is set for non-default draw "Casette nr 2" and the line
    > above print it out the way it supposed to be - to the "Casette 2"
    >
    > when I do something like this by PHP:
    >
    > $link = "\"c:\\Prog ram Files\\Adobe\\A crobat
    > 7.0\\Reader\\Ac roRd32.exe\" /t \"c:\\Progra m Files\\Adobe\\A crobat
    > 7.0\\Reader\\te st.pdf\" \"labelprinter\ "";
    >
    > and try to execute it either with exec, shell_exec or $WshShell->Run
    > from WScript.Shell object, it printing test.pdf but it does not use
    > non-default already set "Casette 2". The page is still printed on
    > "Casette 1".
    >
    > Where is the problem? I would say with printer or Adobe, but when I go
    > by cmd.exe on the server, it is printed out properly "Casette 2", but
    > when I try to execute by PHP using the same batch script line, it
    > stills go to the wrong Casette 1.
    >
    >
    > Did for anyone this issue sound familiar?
    >
    >
    >
    > Any help will be greatfull :)
    >[/color]


    Comment

    • joe1977@tlen.pl

      #3
      Re: What is the difference between raw cmd execute on server, and executing by Apache/PHP

      I forgot to say, that this was also my solution, but it acts the same
      as from PHP which is wrong :(

      Comment

      Working...