java运行vbs_如何在Java中执行VBS脚本?
如何在Java中執行VBS腳本?他喜歡什么樣的方式?我在互聯網這么多意見發現,所以我不知道什么是更好的...如何在Java中執行VBS腳本?
1.
Runtime.getRuntime().exec("cscript //NoLogo " + file.getPath());
2.
Runtime.getRuntime().exec("wscript.exe " + file.getPath())
3.
String script = "C:\\work\\selenium\\chrome\\test.vbs";
String executable = "C:\\windows\\...\\vbs.exe";
String cmdArr [] = {executable, script};
Runtime.getRuntime().exec (cmdArr);
4.
Runtime.getRuntime().exec("cmd /c a.vbs");
5.
Desktop#open(new File("c:/a.vbs"));
而且這還不是全部。
這是什么樣的選擇?我需要執行下面的腳本:
If Not IsObject(application) Then
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
2012-11-27
MyTitle
總結
以上是生活随笔為你收集整理的java运行vbs_如何在Java中执行VBS脚本?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: LAMP服务架构
- 下一篇: web漏洞扫描器原理_面向WEB的分布式