Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News Using Windows PowerShell from VBScript, JScript

Using Windows PowerShell from VBScript, JScript

This item in japanese


Sapien Technologies has made available ActiveX PowerShell (ActiveXPosh), a free scripting tool which allows calling the Windows PowerShell from any COM compatible scripting language like VBScript or JScript. ActiveXPosh is useful to enhance existing scripts to make use of the PowerShell functionality.

Sapien describes ActiveXPosh as following:

A COM component that can be used from VBScript, JScript, KiXtart, or any other COM-compatible language. Allows you to create a direct Powershell host and use cmdlets and scripts from within your favorite scripting language. Multiple output options make integration flexible.

An example of using ActiveXPosh can be found in the description document provided by Sapien:

Set ActiveXPosh = CreateObject("SAPIEN.ActiveXPosh")
if ActiveXPosh.Eval("Get-Process Winword") = vbTrue Then
     WScript.Echo "Word is running"
     WScript.Echo "Word is NOT running"
End If

The tool's interface is made up from the following commands:

  • ClearOutput() - This method clears the internal output buffer.
  • Execute(strcommand) - Executes a PowerShell command or script.
  • Eval(strExpression) - Evaluates a PowerShell expression.
  • Init(execProfile) - Initial call to instantiate a PowerShell engine.
  • IsPowerShellInstalled - Returns True/False.
  • Output - A collection of strings filled with output from
    PowerShell commands.
  • OutputString - The content of the output buffer as a single string.
  • OutputMode - Sets or gets the current output mode.
  • OutputWidth - Sets or gets the desired output width.

ActiveXPosh is offered with other free scripting tools under the Free Tools Universal License Agreement.

We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.