You can run vbscript using "cscript.exe", which comes with windows.
Depending on your scenario, you can run this with Java in various ways:
- use Runtime.exec to run the program. You can do this directly as part of your program.
- use Ant, which has an exec task, or maven, which has an exec plugin. This is most useful when invoking a script as part of an assembly or some other batch process.
EDIT: If your script has a graphical interface, use "wscript.exe".
I assume you mean vbscript, but if you mean a macro such as a Word macro, then you will need to do something like this:
"C:\Program Files\Microsoft Office\Office12\Winword.exe" "C:\MyPath\MyDoc.doc" /m"Macro1"
Alternatively, you can create a small vbscript that creates a Word application and uses the run () method to invoke the macro. You are executing this script with cscript.exe / wscript.exe.
mdma
source share