Reputation: 223
The command inside shell_exec method will obviously work on command line. I tried this method on web server but it doesn't work. Is there any additional syntax on how to trigger this?
echo shell_exec("'C:\Program Files\Adobe\Reader 10.0\Reader>AcroRd32.exe' /t C:\Documents and Settings\cgcuser\My Documents\Downloads\Documents\sample.pdf \\myserver\myprinter");
Upvotes: 0
Views: 780
Reputation: 27
I would go for a different approach wich works fine in Windows 10
$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Run("AcroRd32.exe /t my.pdf", 0, true);
Upvotes: 0
Reputation: 951
Looks like you need to escape your backslashes.
Also, your second argument looks like it needs to be enclosed as a String.
echo shell_exec("'C:\\Program Files\\Adobe\\Reader 10.0\\Reader>AcroRd32.exe' /t 'C:\\Documents and Settings\\cgcuser\\My Documents\\Downloads\\Documents\\sample.pdf' \\\\myserver\\myprinter");
Upvotes: 1