Windows Scripting
  Home arrow Windows Scripting arrow Page 3 - More Windows Scripting Workarounds from Ni...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

More Windows Scripting Workarounds from Nilpo
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2009-02-25

    Table of Contents:
  • More Windows Scripting Workarounds from Nilpo
  • Implementing Password Masking
  • Masking Passwords without ScriptPW
  • More on Password Masking without ScriptPW

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    More Windows Scripting Workarounds from Nilpo - Masking Passwords without ScriptPW


    (Page 3 of 4 )

    Masking Passwords without ScriptPW

    Okay, so using ScriptPW isn't technically a workaround, although it is a little-known scripting secret.  But, what happens if you're not on a machine running Windows XP or Server 2003 and don't have access to the scriptpw.dll file?

    I'm glad you asked.  That will allow me to introduce a workaround.

    This workaround makes use of HTML's form inputs.  As you may know, HTML has a form input element specifically for receiving passwords.  It's a specialized input box that employs password masking.  The example in this script works with an HTML page and reads the values from the HTML form.

    The code in this workaround is slightly complex.  I want you to see the code in its entirety first, then I'll explain the key parts.  To begin, let's look at the HTML page required.

    <html>

    <head>

    <title>Please Enter Your Password</title>

    <script language="VBScript"><!--

       Sub RunScript

           OKClicked.Value = "OK"

       End Sub

     

       Sub CancelScript

           OKClicked.Value = "Cancelled"

       End Sub

    // --></script>

    </head>

    <body>

    <font size="2" face="Arial">Password:&nbsp;&nbsp;&nbsp; </font>

    <font face="Arial">

    <input type="password" name="UserPassword" size="40"></font>

    <p>

    <input type="hidden" name="OKClicked" size = "20">

    <input id="runbutton" class="button" type="button" value=" OK " name="ok_button"

       onClick="RunScript">&nbsp;&nbsp;&nbsp;

    <input id="runbutton" class="button" type="button" value="Cancel" name="cancel_button"

       onClick="CancelScript">

    </body>

    </html>

    This HTML page has two crucial parts:  the first is the HTML form and the second is a VBScript in the HEAD section of the document.

    This example does use VBScript, therefore it will need to be run in Internet Explorer.

    The basics of this HTML form aren't important.  What is important is the use of the password input box and the id that has been given to it.  Notice also that there are two buttons.  One is used to "submit" the form; the other is used to cancel submission.  You should also notice that both have the same id.  While having two elements with the same id is a violation of coding standards, it does provide us with a quick and dirty method of passing two possible values to our script without needing to check two different elements.

    More Windows Scripting Articles
    More By Nilpo


     

    WINDOWS SCRIPTING ARTICLES

    - More Windows Scripting Workarounds from Nilpo
    - Overloading Methods and More in VBScript
    - Improving MFC for Windows Vista
    - Regular Expressions in VBScript
    - Working with Dates in WMI
    - Completing Calendars with VBScript Date Func...
    - Building Calendars with VBScript Date Functi...
    - Working With Dates and Times in VBScript
    - Designing WCF DataContract Classes Using the...
    - Understanding Dates and Times in VBScript
    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek