2

How to convert the following VBScript code to use with JScript in TestComplete? We are trying to invoke the application/.exe using Windows Script Host functions instead of the predefined functions in TestComplete.

strExe = "C:\whatever\myprogram.exe -h1 -d33"
Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = objShell.Exec(strExe)
strExeOut = objScriptExec.StdOut.ReadAll
Helen
  • 87,344
  • 17
  • 243
  • 314
Karthik R
  • 21
  • 2

2 Answers2

1

Here's the JScript version:

var strExe = "C:\\whatever\\myprogram.exe -h1 -d33";
var objShell = new ActiveXObject("WScript.Shell");
var objScriptExec = objShell.Exec(strExe);
var strExeOut = objScriptExec.StdOut.ReadAll();
Helen
  • 87,344
  • 17
  • 243
  • 314
1

I've written a blog article on this. You can find it here: http://blog.dimaj.net/2011/02/howto-start-application-from-jscript-and-specify-start-in-folder-attribute/

Aside from launching an application, I'm also describing how to set the 'start in' option since some application must have that option set.

dimaj
  • 11
  • 1