WSHに対応した OpenVBS COM でClassic-ASPを動かしてみよう! / Let’s try to Classic-ASP by OpenVBS COM compatible with WSH!

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>

    dim a:
  <h2><% response.write("hello! " & a) %></h2>
  <h2><%= "你好" %></h2>


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“?



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s