0

I need to print a generated text-file with perl. I'm using xampp, Windows7 64 bit. My perl-script is containing the print system call:

$system = "print\ /d:\\\\SERVER\\PRINTER\ C:\\xampp\\cgi-bin\\textfile.txt";
system ($system);

When i try the same line in the cmd-shell, the print works.

The answer is:

C:\xampp\cgi-bin\textfile.txt wird momentan gedruckt.

but nothing else happens.

I then tried to create a batch-file. Starting the batch-file manually starts the print. From a system()-call nothing happens.

Then i tried another way, showing the file in Firefox first. I copied the file to my htdocs-dir and changed my batch-file to:

cd "c:\Program Files (x86)\Mozilla Firefox"
firefox.exe -new-window http://localhost/textfile.txt

Doubleclicking the bat starts my firefox and my textfile. The system()-call ist not working.

Any Ideas?

Tom

4

1 回答 1

1

My brother found the reason. THANKS CHRIS! It was a problem with the permissions. The apache service is running without normal user permissions. To set user permissions (or, better: special defined, new permissions) in Windows 7 pro 64 bit: (Sorry, this is german)

Task-Manager "Dienste" rechts unten auf "[Adminzeichen] Dienste" Auf Dienst "Apache" rechtsklick "Eigenschaften" Reiter: "Anmelden" Auswahl: "Dieses Konto" User und Passwort rein "Übernehmen" und "OK"

Dann nochmal auf "Apache" linksklick und links auf "neu starten"

于 2012-05-02T12:05:56.620 回答