HTA files Remove HTML control authentication and receive command line arguments _vbs

Source: Internet
Author: User
one is to use the HTA to remove the HTM control validation
The code for HTA1 is as follows:
Copy Code code as follows:

<title>sample HTML Application One</title>
<body onload= "viewer.document.location.href= ' activexcontrol.htm '" >
<iframe id= "Viewer" application= "yes" ><!--here is the key to removing validation-->
</iframe>
</body>

The activexcontrol.htm code is as follows:
Copy Code code as follows:

<script language= "VBSCRIPT" >
Dim filesystem
' Creates the FileSystemObject
Set filesystem = CreateObject ("Scripting.FileSystemObject")
</script>

This will remove the HTM local validation.
second, the HTA receives command line arguments
The code in the book I guess wrong, impossible to succeed, I studied, Hta2 should write this:
Copy Code code as follows:

Id= "Mysamplehta"
caption= "Yes" >
<title>sample HTML Application Two</title>
<body>
<script language= "VBScript" >
Cmdlinearray = Split (mysamplehta.commandline) ' This is to turn the arguments in the command into an array
MsgBox Cmdlinearray (UBound (Cmdlinearray)) ' receives the last parameter
A=document.getelementbyid ("Mysamplehta"). CommandLine ' This is a string, not an array.
MsgBox TypeName (a) & "--" &a "validation
</script>
</body>

At the command line: Hta2 LCX will pop up the lcx dialog box

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.