Since this is so popular and simple, yet people somehow still have problems getting it to work, I've also added a VBScript file you can run, which will prompt you for the username, password, and URL of the protected page.
The URL is not validated, so if the resulting password file doesn't work, you probably typed the URL wrong.
The .zip file is attached to this message.
Just double click on the "PasswordHelper.vbs" VBScript file and follow the instructions to create your password file(s). You need to run this file locally, and then upload the password file(s) to your website.
Note: VBScript is a İMicrosoft technology, so this file will only work on Windows!
This file is safe to run. If you get any warnings, or are concerned, you can open the .vbs file with notepad, and make sure that the code matches the following:
Dim UserName, Password, RedirectPage
Dim fs, f
While NOT IsAlphaNumeric(Username)
If Username <> "" AND NOT IsAlphaNumeric(Username) Then
MsgBox "Username must be alphanumeric, without spaces!",16,"Password Helper"
Username = InputBox("Enter Username:","Password Helper")
While NOT IsAlphaNumeric(Password)
If Password <> "" AND NOT IsAlphaNumeric(Password) Then
MsgBox "Password must be alphanumeric, without spaces!",16,"Password Helper"
Password = InputBox("Enter Password:","Password Helper")
While RedirectPage = ""
RedirectPage = InputBox("Please enter the URL of the password protected page:","Password Helper")
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile(LCase(Trim(Username)) & LCase(Trim(Password)) & ".js",2,True)
f.WriteLine("auth = true;")
f.Write("redirect = """ & RedirectPage & """;")
Set f = Nothing
Set fs = Nothing
MsgBox "Password file created!",0,"Password Helper"
Set ianRegEx = New RegExp
ianRegEx.Pattern = "^[a-zA-Z0-9]+$"
ianRegEx.Global = True
IsAlphaNumeric = ianRegEx.Test(str)