PRB: RUN Command Gives 'Invalid Parameter' Error on Windows NT

Last reviewed: June 27, 1995
Article ID: Q131310
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5 and 2.6

SYMPTOMS

When using the FoxPro RUN command you may receive the error "Invalid Parameter" when trying to pass a parameter to the command that was trying to run.

CAUSE

This problem occurs only under Window NT (including version 3.51). It is evident when trying to use the MS-DOS copy command to redirect output to a network printer:

   RUN COPY C:\CONFIG.SYS \\COMPUTER\PRINTER

The problem occurs because the file FOXRUN.PIF is pointing to the file COMMAND.COM which is not a Windows NT valid command prompt file. This works fine under Windows version 3.1 and Windows for Workgroups version 3.11.

WORKAROUND

To solve this problem, use the PIF Editor utility (PIFEDIT.EXE) located in the Main Group in the Program Manager to create a .PIF file that points to CMD.EXE, which is the Windows NT command prompt. The file is located in the SYSTEM32 directory (usually C:\WINNT\SYSTEM32\CMD.EXE). Then call the new .PIF file from FoxPro as in this example:

   RUN /N MY.PIF /C COPY C:\CONFIG.SYS \\COMPUTER\PRINTER

Steps to Create the PIF File

  1. Run the PIF Editor in the Main group.

  2. Give CMD.EXE as the Program Filename.

  3. Select or clear the "Close Window on Exit" check box to indicate whether or not you want the MS-DOS session to close as soon as it finishes.

  4. From File menu, choose Save As and give the .PIF file a name like MY.PIF

  5. Copy the .PIF file to the FoxPro directory, and execute the RUN /N command.

STATUS

This behavior is by design.


Additional reference words: FoxWin 2.50 2.60 Invalid Parameter
KBCategory: kbenv kbprb
KBSubcategory: FxenvOs


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.