Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29234 Diskussionen

How to Proceed without Waiting for the Completion of a Sub-task?

tom_c_lin
Einsteiger
1.212Aufrufe

Hi Everyone,

My program makes the following system call to start a sub-task, i.e., run prog.exe.

prog.exe datafile.dat

The calling program always wait until the completion of the sub-task before it proceeds. Can any of you show me how to make the calling program proceeds without waiting ? Thanks in advance. Good Day.

Tom Lin

0 Kudos
4 Antworten
anthonyrichards
Neuer Beitragender III
1.212Aufrufe
Try ShellExecuteEx. I would have posted some code, but I have just found that 
I cannot paste anything into this blasted window!

					
				
			
			
				
			
			
			
			
			
			
			
		
hajek
Einsteiger
1.212Aufrufe
Hi Tom,
Try executing (through SYSTEM)
'start prog.exe datafile.dat' (which launchs a separate cmd shell window)
or
'start /B prog.exe datafile.dat' (which doesn't, useful for windows GUI app)

Steven_L_Intel1
Mitarbeiter
1.212Aufrufe

Example of ShellExecute

You can paste with CTRL-V or the Paste icon in the editing toolbar (third from left in bottom row.) For pasting code, use the icon on the far right of the bottom row.)

tom_c_lin
Einsteiger
1.212Aufrufe

Thank you all for prompt replies. The command 'start /B' is what I am looking for. Because our programs are triggered by activities on Sun, we have to use Window Service. Creating a window to run will not work. Thanks again. The forum has been extremely helpful to my project. I really appreciate that.

Tom Lin

Antworten