Hi all,
I just wanted to execute a DOS command from a XSI script, and the JScript doc says we can use the following code:
var WshShell = new ActiveXObject("WScript.Shell");
var oExec = WshShell.Exec("calc");
while (oExec.Status == 0)
{
WScript.Sleep(100);
}
This bad script works well until it hits the WScript.Sleep call, as the
global variable WScript doesn't seem to exist in the XSI scope.
However, the JScript doc says:
The WScript object is the root object of the Windows Script Host object
model hierarchy. It never needs to be instantiated before invoking its
properties and methods, and it is always available from any script file.
I would assume they forgot to mention that it was not available in XSI...
I also tried ActiveXObject("WScript.WScript") and ActiveXObject("WScript") just in case but to no avail.
Don't tell me to use Python, I know it would have been a lot easier;).
Thanks for any tip on this one!
Aloys
--
Aloys Baillet - XSI Technical Director
Character Dpt - Animal Logic
--