A COM DLL that compatible with Windows WSH was added to the OpenVBS .
VBScript互換のオープンソースなスクリプトエンジン「OpenVBS」 に、Windows “WSH” に対応したCOM DLLが追加されました。
You can get openvbs.dll by building it on Windows, let’s do the regsvr32.
Windowsでソースをビルドすると openvbs.dll を得ますので、regsvr32 します。
Then run the cscript.
あとは cscript で実行するだけで、
It will done successfully.
動作します。
option explicit
dim a = 1
dim b = 2
wscript.echo a+b & "です"
dim o = createobject("scripting.dictionary")
o("aaa") = 123
wscript.echo o("aaa")
dim fso = createobject("scripting.filesystemobject")
wscript.echo fso.getfolder(".").path
This is the test code this time. You can do initialize a variable on declaration time like “dim a=1” in OpenVBS .
ちなみに今回の test.obs はこんな感じ、「dim a=1」のように宣言と同時に入れれたりします 。
<%@ language="openvbs" %>
<% option explicit %>
<% response.codepage = 65001 %>
<% response.charset = "utf-8" %>
<!DOCTYPE html>
<html>
<body>
<%
dim a:
a=123:
%>
<h1>こんにちは</h1>
<h2><% response.write("hello! " & a) %></h2>
<h2><%= "你好" %></h2>
</body>
</html>
Next is on the ASP(Original, Classical). OpenVBS can work by “language=’openvbs'”.
次は ASP(Original, Classical)。「language=”openvbs”」を指定すれば OpenVBS で動作します。(openvbs.dllに権限付与を忘れずに)
This is experimental version yet, but it will work. Do you want to use modern VBScript “OpenVBS “?
まだα版にも満たない状態ですが、ひとまず動作はok。近代のテクニックにも対応した2020年の新しいVBScript「OpenVBS 」はいかが?
.