Page 1 of 1

launch vbs file in an AE script

Posted: May 7th, 2012, 12:18 pm
by lougris
Hello,

How could you launch a vb script in AE, i've tried to do this :
var vbsFile = new File(pathVbsFile);
vbsFile.execute();

But it doesn't work...

Thanks in advance

Fred

Re: launch vbs file in an AE script

Posted: May 9th, 2012, 6:51 pm
by zold
Check page 169 of CS3 (+) scripting guide:
System callSystem() method
system.callSystem (cmdLineToExecute); Description
Executes a system command, as if you had typed it on the operating system’s command line. Returns whatever the system outputs in response to the command, if anything.
In Windows, you can invoke commands using the / c switch for the c m d . e x e command, passing the command to run in escaped quotes (\ " . . . \ " ). For example, the following retrieves the current time and displays it to the user:

Code: Select all

var timeStr = system.callSystem("cmd.exe /c \"time /t\""); alert("Current time is " + timeStr);
cmdLineToExecute
A string containing the command and its parameters
etc.