Page 1 of 1

PHP don't execute batch file using exec

PostPosted: 19. January 2016 06:20
by bladeism
I'm trying to execute a command in PHP

Here's the command

Code: Select all
c:\WINDOWS\system32\cmd.exe /b START C:\xampp2\htdocs\barcodeprinting\test\printbarcode.bat


I also tried the following commands

Code: Select all

system('cmd /c C:\xampp2\htdocs\barcodeprinting\test\printbarcode.bat');
shell_exec('c:\WINDOWS\system32\cmd.exe /b START C:\xampp2\htdocs\barcodeprinting\test\printbarcode.bat');

$command = "C:\xampp2\htdocs\barcodeprinting\test\printbarcode.bat";
pclose(popen("start /B ". $command, "r"));




I'm using XAMPP 1.8.2 using an admin account I already check the
interact with computer in services.msc of Apache.

I don't know what to do I'm stuck here. Please help me thanks!

Re: PHP don't execute batch file using exec

PostPosted: 19. January 2016 09:04
by Altrea
=> http://stackoverflow.com/questions/1219 ... c-problems
(answer from "Mike Mackintosh" explains how you can debug shell_exec problems)