Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Run dos program and wait.
Message
De
10/08/2004 08:25:57
 
 
À
09/08/2004 16:37:27
Scott Sherman
Puyallup Tribal Health Authority
Tacoma, Washington, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00931875
Message ID:
00932000
Vues:
18
>I have the need to fire off a DOS program but I need know when it finishes. If I use the below code, the program kicks off just fine but it is in no wait mode so I have no idea when it finishes. If I remove the /N from the RUN statement in hopes that the FoxPro program with wait, the program crashes. Does anyone have any idea how I can make FoxPro wait for the DOS program? The help says something about .pif files but I do not know how to create or use these either.
>
>SLIMCOMMANDLINE = 'SLIMBATCH ' + '/IMPORT=("' + m.assettextfilename ;
> + '","' + m.assetsisfilename + '")' ;
> + ' /IMPORT=("' + m.transtextfilename + '","'
> + m.transsisfilename + '")' ;
> + ' /TRUVP=("' + m.exportfilename + '")'
>
>RUN /N &SLIMCOMMANDLINE


You can use WSH:
#define SW_SHOW_NORMAL 1
#define SW_SHOW_MINIMIZED 2
#define SW_SHOW_MAXIMIZED 3
oShell = createobject("WScript.Shell")
oShell.Run(SLIMCOMMANDLINE,SW_SHOW_NORMAL,.T.)
or WinAPI:
DECLARE INTEGER ShellExecute ;
	    IN SHELL32.DLL ;
	    INTEGER nWinHandle,;
	    STRING cOperation,;
	    STRING cFileName,;
	    STRING cParameters,;
	    STRING cDirectory,;
	    INTEGER nShowWindow

ShellExecute( 0, "Open", "SLIMBATCH", "<parameters here>", "", 1 )


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform