Run exec function in PHP
I am using exec function to run a bat file and change the default printer. exec file is doing fine, bat file alone is doing fine, but the printer doesn't change when I'm calling the bat file via exec function. I put "echo 1" in the bat file. Browser s开发者_JS百科howed "1" but my printer didn't change. I really need a miracle to solve this !! my OS is Microsoft Server 2003. any ideas?
Sounds like a permissions issue. The user your web server is running as can run the batch file, but the batch file doesn't have permissions to change the printer (and is failing quietly).
精彩评论