Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keyboard Shortcut - Auto Login to a WordPress Dashboard
If you maintain a WordPress site, chances are that you frequently have to go through the tedious process of accessing the Dashboard, which includes launching a web browser, opening the WordPress login page, inputting your username and password, and then clicking the Log In button. The following AutoHotkey script can be used with ShortKeeper to create a keyboard shortcut to automate the whole process.

Need help creating a keyboard shortcut with ShortKeeper using the following AutoHotkey code? This 5-minute tutorial will help!

Attention: This AutoHotkey script is kept for reference purposes only. It is based on the web browser Internet Explorer, which is no longer supported or updated by Microsoft.
Username := "YourUserName"
Password := "YourPassord"
URL := ""
wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := True
TimeOut := 10
While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy
 Sleep, 1000
 TimeOut := TimeOut - 1
 if (TimeOut = 0)
Sleep 500
wb.document.getElementById("user_login").value := Username
wb.document.getElementById("user_pass").value := Password
At lines #1 and #2, "YourUsername" and "YourPassword" must be replaced with the actual user name and password (do not remove quotation marks).

At line #3, "" must be replaced with the actual URL of the WordPress login page (do not remove quotation marks).

At line #7, a timeout delay of 10 seconds is set in case the script becomes unresponsive (e.g. due to a slow Internet connection) in attempting to load the WordPress login page. If the timeout expires, the script will simply terminate without inserting the username and password. The timeout delay can be changed if needed.

At line #15, a 500 milliseconds pause is inserted after the WordPress login page is loaded and before inserting the username and password. You might have to lengthen the pause for a slow computer.

Use a password stored in an external encrypted file

Someone with access to your ShortKeeper application might be able to see your WordPress password, which some users may find insecure. This section explains how to use a password stored in a separate file that is protected with a master password.

To begin, replace line #2 of the script above with the following two lines:
PasswordName := "wordpress1"
ExternalFileName := "T:\MyData.ini"
At line #2, "T:\MyData.ini" must refer to the path and filename of the external password file (do not remove quotation marks).

Now, to get the password from the external file, the following line of code must be inserted between line #16 and line #17 of the script above:
IniRead, Password, % ExternalFileName, % "Passwords", % PasswordName

The following line inserted between lines #17 and #18 will make sure the password in the computer memory is cleared as soon as possible:
Password :=

Then you will have to create an external file (a simple text file will do) with an ".ini" extension with content like this:


You can add all of your other passwords to the same file.

If the external file cannot be read (e.g. if it is encrypted), the inserted password will be "ERROR" instead of the actual password.

There are several ways to encrypt/decrypt the external file. If you are using TrueCrypt, you could insert the following code between lines #3 and #4 above. This will prompt you to enter the master password if the file is not already decrypted:
if (!FileExist(ExternalFileName))
 TrueCryptPath := "C:\Program Files (x86)\TrueCrypt\TrueCrypt.exe"
 ContainerPath := "U:\"
 RunWait % TrueCryptPath . " /q /lt /v " . ContainerPath
At line #3, "C:\Program Files (x86)\TrueCrypt\TrueCrypt.exe" must refer to the path of TrueCrypt.exe (do not remove quotation marks).

At line #4, "U:\" must refer to the path of the TrueCrypt file container (do not remove quotation marks).
Enterpad: For those who need more than a few shortcuts.

Thanks for sharing this script. Currently, I own a multi-vendor market place and I want to know if this script will work with my website. I have used to get my theme and I want to get this feature. In case this will work please contact me in PM. I don't want to change the theme of my website because I really love it and it helped me a lot to get a bunch of customers and all of them said that they love how my website works. Plus how good I am working and how well my website works make my shop just perfect.
I tested the script (with Internet Explorer and TrueCrypt installed) and it still works.
Enterpad: For those who need more than a few shortcuts.


Forum Jump:

Users browsing this thread: 1 Guest(s)