AnsweredAssumed Answered

Executing a batch from a script

Question asked by shlomi on Nov 14, 2007
Latest reply on Dec 1, 2009 by anovotny
Hello,

My alfresco is installed on windows, and I have created a space called incoming. There is a rule on this space, that distribute the files from it to their respective space.

In a specific situation, I want to execute a batch file (.bat), that loads the content of the file into the DB (oracle), using sqlldr, and then move it.

My script is written in JavaScript, and runs on the server side.

I tried the example below:
var oShell = new ActiveXObject("Shell.Application");

var commandtoRun = "calc.exe";

// Invoke the execute method.
oShell.ShellExecute(commandtoRun, "", "", "open", "1");

That has raised a ScriptException, with the error "ActiveXObject is not defined".

Is there a way to do it??

This is really important, and I have to demonstrate this tomorrow.
Please let me know what is the best way to do it..

Shlomi

Outcomes