好的,我在这里做错了什么?我正在尝试以这种方式包含一个带有类的vbscript:
脚本.VBS:
set inc = createobject("script.runner")
inc.Include "class"
set x = new test
x.msg' here i get the error 'undefined class'!
注册的 .wsc 文件:
<?xml version="1.0"?>
<component>
<registration
description="wsc"
progid="script.runner"
version="1.00"
classid="{f65e154c-43b3-4f8f-aa3d-535af68f51d1}"
>
</registration>
<public>
<method name="Include">
<PARAMETER name="Script"/>
</method>
</public>
<script language="VBScript">
<![CDATA[
Sub Include(Script)
ExecuteGlobal(CreateObject("scripting.filesystemobject").OpenTextFile(Script & ".vbs", 1).Readall & VBNewLine)
End Sub
]]>
</script>
</component>
类.VBS:
class test
public sub msg
msgbox "hi"
end sub
end class
我在想如果我要使用类或其他东西,也许我需要在 wsc 文件中定义它?我不知道..
谢谢你的帮助!