在vbscript中使用HTA [英] Using HTA in vbscript

查看:93
本文介绍了在vbscript中使用HTA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将HTA用户窗体用于VBscript时,我发现HTA不支持WScript及其对象/方法.

While using HTA userform for VBscript, I found that HTA doesn't support WScript and its objects/methods.

是否有创建用户表单的其他方法,或者理论上有没有使HTA支持WScript的方法?

Is there any alternate way of creating userform or is thery any way to make HTA support WScript?

推荐答案

WScript.Echo的替代方法是简单地将内容添加到DOM:

An alternative to WScript.Echo would be to simply add content to the DOM:

<script language="vbscript">
    dim div: set div = document.getElementById("output")
    div.innerText = "output"
</script>

<div id="output"/>

,或者如果您想要一个对话框,则可以使用MsgBox()

or if you want a dialogbox instead, you can use MsgBox()

<script language="vbscript">
    MsgBox "output"
</script>

您可以在不使用WScript

<script language="vbscript">
    dim fso: set fso = CreateObject("Scripting.FileSystemObject")
    dim path: path = fso.GetAbsolutePathName(".")
    '... etc
</script>

这篇关于在vbscript中使用HTA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆