xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

RUN

Executes an operating system command.

Syntax

RUN <CommandLine>

Arguments

<CommandLine>
This is the command to be executed on the operating system level. It can be specified as literal or as character string in parentheses.

Description

The RUN command opens a new command shell and executes the operating system commands specified with <CommandLine>.

RUN does not return until <CommandLine> is completed by the operating system. When RUN is complete, the new command shell is closed.

Info

See also:( ), FUNCTION, PROCEDURE
Category: Statements
Source:vm\run.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example executes the DIR command, directs its output into
// a file and displays the result with Notepad.exe

   PROCEDURE Main
      LOCAL cCommand := "Notepad.exe files.lst"

      CLS

      ? "DIR command"
      RUN dir > files.lst

      ? "Executing Notepad.exe"
      RUN (cCommand)

      ? "Done"
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe