Miraplacid Scripting Components Manual

 
 

Miraplacid MSCExec 1.1

MSCExec Component allows you to call OS command or launch an application right from your script. You can set paramentrs for the call and check results.

Component creation

To create component, use following constructions
  • JScript: var obj = Server.CreateObject("Miraplacid.MSCExec");
  • VBScript: set obj = Server.CreateObject("Miraplacid.MSCExec")

Note: Component designed for Apartment threading model. Therefore, the best scope of their using is ASP page level scope.
Using components of version 1.1 in Application and Session scopes may cause problems with your ASP Server (IIS or Chili) productivity.
To learn more about ASP execution scopes, see your ASP Server manual.

Object reference


Method Parameters Return Value Description
System String cmd Long Call OS command specified by cmd and return system return value.
Execute String cmd String Launch a specified application with parameters provided. Return a string with stdout and stderr values.
Command line with path to application and parameters provided in cmd.
ExecuteEx String cmd,
String in
MSCExecResult Extended application call.
Command line with path to application and parameters provided in cmd. Parameter in allow you to specify data that will be enterpreted as stdin source.

MSCExecResult auxiliary object

Component MSCExecResult is used for storing ExecuteEx method results (MSCExec object). It has 3 methods to access data from stdout, stderr and program exit code.

MSCExecResult object reference


Property Type Description
Stdout String Get data from program's stdout
Stderr String Get data from program's stderr
RetVal Long Get program exit code

Notes

  1. For OS Linux the Component always use system function "system". For Windows platforms method System use "system" function call from standard C library, other methods use function _spawn.
  2. Command line style should be adjusted to OS. For Windows file name and path could contain space characters. In this case they should be enclosed in quotation marks.
  3. This component could be unsafe. Do not let your Web site visitors specify an OS command or application to run!
  4. This component doesn't work under Personal Web Server on Win9x.
 
 
Technical Support   Copyright © 2001, 2002 by Miraplacid