Results 1 to 4 of 4
Thread: Execute command but don't wait?
Apr 27, 2006, 09:57 #1
Execute command but don't wait?
Is there a way to run a command-line program or command but not wait until it has exited before continuing with the script's execution? I don't need the output of the command, I just don't want the script to hang while this outside program runs its course. (PHP5/Apache2 under Windows)
Apr 27, 2006, 10:07 #2
- Join Date
- Apr 2006
- 0 Post(s)
- 0 Thread(s)
Apr 27, 2006, 10:44 #3
I tried his method exactly and had problems. Running "dir /S D:\ > outputfile" caused it to create the file and lock it so that it can't be deleted, but never write to it. I tried running shell_exec('start dir /S D:\ > outputfile'), which should work the same way, but still had problems.
Have you ever had this working?
Apr 27, 2006, 10:55 #4
I found the problem. That command causes the batch file to run the command "start dir /S D:\ > outfile", which means that the output of the start command is being written to the file, not the command that start is forking off (dir).
Is there a way around this?