PHP Get default printer via comand line in windows 7
i have a script go get defaul printer via cmd
cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -g >
C:\xampp\htdocs\photo\printer.txt
and the result printer.txt is
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
The default printer is Canon SELPHY CP780
but when i run and execute in php with this script
<?php
exec('C:\WINDOWS\system32\cmd.exe cscript
C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -g >
C:\xampp\htdocs\photo\printer.txt');
?>
the result is
Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft
Corporation. All rights reserved.
where is the printer name? is there someting wrong with my code? is there
any solution?
php ver 5.4.4 and os win 7 64bit.
No comments:
Post a Comment