exec() How to execute a bat

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Vandiike
Forum Newbie
Posts: 4
Joined: Mon Jul 21, 2003 8:47 am
Location: Greece

exec() How to execute a bat

Post by Vandiike »

Hello all, I am trying to execute a bat file, and its not working. I manage to get the CMD in the "win task list" however its not executing the bat file, and its not closing it self...?? What I need it for is to execute a modem to send a SMS. I got that working but the php stuff is not really my bussiness...so please, I need some help.

I have tried:

<?php
exec('c:\\WINNT\\system32\\cmd.exe /c START c:\\test.bat > c:\\xxx.txt');
?>

Os:win 2000

Can anyone sheed some light on this...?

Thanks in advance
Vandiike
Forum Newbie
Posts: 4
Joined: Mon Jul 21, 2003 8:47 am
Location: Greece

Post by Vandiike »

I asume that this is harder than I thought it would be, since there is no reply. I thought this would be standard stuff, executing a bat file on a Apache Web Server machnie...guess not.
Vandiike
Forum Newbie
Posts: 4
Joined: Mon Jul 21, 2003 8:47 am
Location: Greece

Post by Vandiike »

conversating with my self is pretty nice, but I would like an expert opinion. My area of expertise is with c++, if anyone need some help...
Post Reply