2

次の VBScript コードを TestComplete の JScript で使用するように変換する方法は? TestComplete の定義済み関数の代わりに、Windows Script Host 関数を使用して application/.exe を呼び出そうとしています。

strExe = "C:\whatever\myprogram.exe -h1 -d33"
Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = objShell.Exec(strExe)
strExeOut = objScriptExec.StdOut.ReadAll
4

2 に答える 2

3

JScript のバージョンは次のとおりです。

var strExe = "C:\\whatever\\myprogram.exe -h1 -d33";
var objShell = new ActiveXObject("WScript.Shell");
var objScriptExec = objShell.Exec(strExe);
var strExeOut = objScriptExec.StdOut.ReadAll();
于 2011-01-17T14:31:26.123 に答える
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.

于 2011-06-21T21:54:35.913 に答える