• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

Shell_exec problem!!!

Hi all;

 Well, I need to run a BAT application that is in the server. I'm able to run shell commands as DIR, CD or so, but when I execute the bat for the commerce application, it just opens a windows in order to download page.php...¿?¿?¿?...I'm bothered... why the system is returning me that page??.

The thing is that the BAT I have to run, needs a couple seconds to run.. maybe is this the problem??.. This is the code that works:
<?php
      $Cadena= "dir";
      //$output = shell_exec($Cadena);
      echo "<pre>$output</pre>";
?>

And this is the one that is causing me the BIG problem:

<?php
      $Cadena= "C:\cyberpac\crurltpv C:\cyberpac\tpv.zip C:\cyberpac\tpv.cnf idpedido:1000 importe:10.00 moneda:EUR idioma:esp";
      //$output = shell_exec($Cadena);
      echo "<pre>$output</pre>";
?>

I've tries with system() but the result is the same. Safe Mode is off in my server...HELPPP!!!
Any real help will be rewarded!!!
0
jorvidu
Asked:
jorvidu
1 Solution
 
hernst42Commented:
The \ might cause problems:
Try
 $Cadena= 'C:\cyberpac\crurltpv C:\cyberpac\tpv.zip C:\cyberpac\tpv.cnf idpedido:1000 importe:10.00 moneda:EUR idioma:esp';
(' instead of ")
0
 
jorviduAuthor Commented:
JUST PERFECT MAN.

That's the solution... when someone is 134234 hours in front the same problem and just can't see through that obvious things, you're there!!!. THANKS AGAIN!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now