473,320 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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\Acrobat 7.0\\Reader\AcroRd32.exe" /t
"c:\Program Files\Adobe\Acrobat 7.0\Reader\test.pdf" "labelprinter"
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:\\Program Files\\Adobe\\Acrobat
7.0\\Reader\\AcroRd32.exe\" /t \"c:\\Program Files\\Adobe\\Acrobat
7.0\\Reader\\test.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 :)

Mar 17 '06 #1
2 2521
try to generate by php a .bat file, execute it, and then delete the .bat
file
<jo*****@tlen.pl> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
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\Acrobat 7.0\\Reader\AcroRd32.exe" /t
"c:\Program Files\Adobe\Acrobat 7.0\Reader\test.pdf" "labelprinter"
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:\\Program Files\\Adobe\\Acrobat
7.0\\Reader\\AcroRd32.exe\" /t \"c:\\Program Files\\Adobe\\Acrobat
7.0\\Reader\\test.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 :)

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

Mar 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sean | last post by:
What is meant by: "CHOWN the entire casetracker folder to something that permits the server to write to it, such as apache.apache, or whatever your Webmaster recommends" - is that 700 or 777...Help...
3
by: Bob Garbados | last post by:
I'm pretty new to php\linux and I'm trying to encrypt a file using gpg from a php page on a linux box and it's not working. The following code works for executing 'ls', but not gpg... ...
33
by: Diez B. Roggisch | last post by:
Hi, today I rummaged through the language spec to see whats in the for ... else: for me. I was sort of disappointed to learn that the else clauses simply gets executed after the loop-body -...
7
by: Brian Burgess | last post by:
Hi all, Anyone know of any special issues with Server.Execute? Specifically for me it simply is not executing ... the server does not transfer to the page specified. The calling ASP just...
4
by: Phil Grimpo | last post by:
I had previously explained this problem in a different thread, but now that I have an IISState log, I figured I'd re-start the thred. My situation and the log are following... I have a very odd...
9
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see)...
0
by: Adam | last post by:
On one site I'm working on I occasionally get an error where instead of executing the PHP file as per normal, the browser sees the page as a file (therefore opens up a execute/save pop-up). All...
10
by: Simon Brooke | last post by:
The DOM API has included public Node importNode(Node,boolean) as a method of the Document interface for a long time. Does anything actually implement it? Xerces 2 is giving me: ...
1
by: walterbyrd | last post by:
I understand that Python has them, but PHP doesn't. I think that is because mod_php is built into apache, but mod_python is not usually in apache. If mod_python was built into apache, would...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.