Microsoft KB Archive/95304

= Three Ways to Use the RUN Command in FoxPro for Windows =

Article ID: 95304

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.5a
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.6 Standard Edition
 * Microsoft FoxPro 2.6a Standard Edition

-



This article was previously published under Q95304



SUMMARY
The RUN command functions differently in Microsoft FoxPro for Windows than in Microsoft FoxPro for MS-DOS. In FoxPro for Windows, the RUN command can be used in three different ways to execute MS-DOS commands and programs, as detailed below.



Method 1
During installation, FoxPro for Windows creates a program information file (PIF) named FOXRUN.PIF in its default directory. The PIF file controls the behavior of RUN commands, such as RUN DIR.

To edit FOXRUN.PIF, start the Microsoft Windows PIF Editor, choose the Open command from the File menu, and select FOXRUN.PIF from the FoxPro directory. Please note the following:


 * Display Usage should be set to Windowed. If Full Screen is selected, the RUN command will be executed in full screen and will switch to a window immediately after the command has been completed. Pressing ALT+ENTER will not allow the display to be switched back to full screen.
 * If the Close On Exit check box is selected, the command will run and the MS-DOS window will be closed automatically upon completion. If Close On Exit is not selected, an inactive MS-DOS window will remain open after the command has been completed.

To close the inactive MS-DOS window, click the control menu of the MS-DOS window and choose Close, or press ALT+SPACEBAR, and then C to close the window. Control will not be returned to FoxPro until the inactive MS-DOS window is closed. The FoxPro screen will temporarily appear to be disrupted.

Method 2
To invoke the MS-DOS command prompt window in FoxPro, execute the following command:

RUN DOSPRMPT.PIF

You can now execute multiple MS-DOS commands at the MS-DOS command prompt. To return to FoxPro, type &quot;exit&quot; (without the quotation marks).

Note: This active MS-DOS session will be displayed in full screen or in a window, depending on the Display Usage setting in the DOSPRMPT.PIF file.

Method 3
Create a customized PIF file for each program, batch file, or command to be executed, and launch it by executing the following command:

RUN / 

This approach allows programs and commands to be executed without disruption of the FoxPro screen. Options available as parameters are listed below:   Option   Result --

n1      Active and normal size n2      Active and minimized n3      Active and maximized n4      Inactive and normal size n7      Inactive and minimized For example, RUN /n2 BACKIT.PIF will run BACKIT.PIF in an active and minimized MS-DOS session.

NOTE: The .PIF must be set up to run in a window, not full screen, in order for the example provided to work correctly (it will flash full screen otherwise).

NOTE: In order for the batch file to finish and return control, an EXIT command must be issued as the last statement of the .BAT file.

Additional query words: VFoxWin FoxWin 2.50 kbvfp300

Keywords: KB95304

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.