|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Submitting a program in the background
How do I submit an executable to run in the background from the command line? On unix, all you have to do is append a '&' to the program on the command line, and it will run in background. Is there such a simple way to also do so on XP?
Thanks |
|
#2
|
|||
|
|||
|
This is default for windows. If you want to wait for the program to quit, you need extra effort.
Dos programs in a window are different though (I guess that's your case?). Afaik it is impossible then because DOS did not have this function. They used TSR programs, but you had to write the program yourself. This mechanism can't be applied to existing programs. hth, M.
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#3
|
|||
|
|||
|
Well, that is 'sort of' my case! I actually posed this question (much more detailed) on the PHP forum, and they moved it here! I am trying to execute a windows program which writes to stdout/stderr, with a system() PHP statement in PHP code running on a browser using Apache on my XP box. The PHP system() command executes my program, which runs for over a minute wall clock, and the PHP page times out. Now, I don't WANT the PHP page to wait for the program to finish, I just want it to push it into the system to run in background, then continue on. That way the page won't time out in the browser.
I was lectured to by the PHP forum that my question wasn't a PHP question, but a Windows question, thus why it was pushed to this forum. So, that is the whole story of this question! Does your reply 'imply' that I just cannot run a background task on a Windows platform from PHP? THANX! Last edited by txgirlta : October 1st, 2003 at 02:24 PM. |
|
#4
|
|||
|
|||
|
Windows does not have the feature of background tasks.
I didn't test it, but you can start programs in a new window via "start <programname>". This would be the equivalent to background tasks in unix. If it has no effect, setup your web server to allow access to the console (in the services settings of the control panel) so it can open new windows. But I doubt this will work at all. One out of many reasons why IMO one should not choose windows for running a web server. hth, M. |
|
#5
|
|||
|
|||
|
Thanks for the suggestion about "start <programname>", I will try that, and cross my fingers!
I TOTALLY agree about your statement about running a web server on Windows - and, ultimately, this web server will be on a linux platform - but the web app I'm writing needs to be portable enough to be run on a laptop that is running XP (this webapp makes its 'debut' as a demo at a tradeshow next week! argggh - deadlines!!!!!), so I am 'trying' to make it as generic as possible (and with as simple capability as possible) so that it can run on both a linux or a windows web-server. I have the Apache server running like a champ on the laptop, as well as mySQL and php, and the webapp itself. The only hitch is this job submission problem!!!! I have faith in myself that I will find 'some' sort of resolution - just hope I can find it by tomorrow (or at latest, Sunday!!!!) Thanks to everyone for their help! Tricia |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Windows Help > Submitting a program in the background |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|