That's because a bat file is a queued list of commands for a prompt. Try the following:
cmd /c myfile.bat
(it may be /k too, forget which executes and closes)
Also, duplicate of How do you run a .bat file from PHP?How do you run a .bat file from PHP?
EDIT
<?php
// http://www.php.net/manual/en/function.exec.php#85930
$_ = null;
// If you care about the return value, use this:
passthru("C:\\WINDOWS\\system32\\cmd.exe /c custom.bat",$_);
header('Content-Type: text/plain');
echo $_;
// if you don't care, just use this:
$_ = exec("C:\\WINDOWS\\system32\\cmd.exe /c custom.bat");
?>