Search code examples
vbscript

How to mask input with VBScript?


does anyone have an idea how to mask the InputBox in VBScript without using html (work security issues)? I'm using windows 10. Thank you very much, any help is greatly appreciated.


Solution

  • In VBScript you essentially have 2 options for masked input:

    • Using the console and a ScriptPW.Password object:

      Set oInput = CreateObject("ScriptPW.Password")
      WScript.StdOut.Write "Enter password: "
      pw = oInput.GetPassword
      
    • Using a custom HTML dialog.

    [Source]

    Masking input in the builtin InputBox dialog is not possible.