PHP don't execute batch file using exec

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP don't execute batch file using exec

Postby bladeism » 19. January 2016 06:20

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!
bladeism
 
Posts: 1
Joined: 19. January 2016 06:11
Operating System: Windows XP

Re: PHP don't execute batch file using exec

Postby Altrea » 19. January 2016 09:04

=> http://stackoverflow.com/questions/1219 ... c-problems
(answer from "Mike Mackintosh" explains how you can debug shell_exec problems)
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 90 guests