Article ID: 141551
Article Last Modified on 2/15/2005
*---------------- Run.prg ----------------------------- * Sample program to Execute an MS-DOS command and keep * the MS-DOS window hidden. * *To use this function in FoxPro to create a new directory, * use the following command: * * DO run WITH "MD C:\VFP\TESTDIR" * FUNCTION run PARAMETER doscmd DECLARE INTEGER WinExec IN win32api AS run ; STRING command, INTEGER param * To have control over the visibility of the * MS-DOS command, call it through a .pif file. * * IMPORTANT: (1) Be sure the "Close Window on Exit" check box in * the PIF file is selected. (2) Be sure "Windowed" is the * selected "Display Usage." cmdstart = SYS(2004) + "FOXRUN.PIF /C " * Now concatenate the two pieces of the command: fullcmd = cmdstart + doscmd retval = run(fullcmd, 0) RETURN retval *------- End of program ----------------------
Keywords: kbhowto kbsample kbcode KB141551