Re: [script] Equivalent of os.system() in JScript?

Date : Wed, 07 Feb 2007 14:23:47 +0000
To : XSI(at)Softimage.COM
From : squid <squid(at)3d-palace.com>
Subject : Re: [script] Equivalent of os.system() in JScript?
I don't really know python but for low (er) level stuff in jscript i'd look to
ActiveX/Com, windows scripting host and .Net


example from a plugin i just finished :

// vbscripting 101 at it's finest ;)
function layoutProcessAlreadyRunning(app){
var iReturn = 0x10;
var goForth = 0x20;
var objWMIService = GetObject("winmgmts:\\\\.\\root\\CIMV2"); // windows management interface
var oColl = objWMIService.ExecQuery("SELECT * FROM Win32_Process", "WQL", iReturn | goForth);
var e = new Enumerator(oColl);
for (; !e.atEnd(); e.moveNext() )
{
var oItem = e.item();


       if(oItem.Name == app)
       {
           return true;
           /*
           Logmessage("Name: " + oItem.Name);
           Logmessage("ProcId: " + oItem.ProcessId);
           Logmessage("ParProcId: " + oItemm.ParentProcessId);
           */
       }
   }
   return false;
}

essentally , a code version of the windows task manager.

for moving, renaming and general shuffling about of files there's always the fso
var fso = new ActiveXObject('Scripting.FileSystemObject');


:)

Bernard Lebel wrote:
Hello,

How do you perform system calls in JScript? A bit like Python's os.system()



Thanks
Bernard
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi



---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.