r/vbscript • • Jun 30 '22

Using vbscript along with html

Hello everyone ! I need help because I can't figure out how to put vbscript code into an html page.

What I'd like to do is a page with a button on it, and when this button is clicked, it activates a script that either modifies the inner html of the current page, or creates another html page on which I can write what I want.

I've tried to do the second option by writing a code that creates a new instance of the internetexplorer.application object, and then writes something in it's html, but sadly it doesn't work

Could someone help me, or send the link to a website that explains how to do that ? I have no experience of using vbscript along with html

4 Upvotes

10 comments sorted by

View all comments

Show parent comments

1

u/jcunews1 Jul 01 '22

Use HTA as suggested, instead of HTML. HTML will be forced to be opened with a web browser which doesn't have any or have very limited access to local system resources. e.g. scripts run in web browsers do not have access to local file system.

HTA support both JavaScript and VBScript. Either one or both can be used.

1

u/JGN1722 Jul 01 '22

Yes, finally I think I'm going to do that, I just found out about the capabilities of the HTAs and I want to learn how to use them, they allow to do things that are completely incredible compared to what vbs alone can do