Monday, April 8, 2013

An updated script to change your gmail password to previous ones!

I lost my MotoACTV watch which I loved so much, and as a results I've changed my gmail and other passwords. But I just realized I could do better by installing programs like AndroidLost to maybe find the android watch.

The problem was I couldn't revert back to my previous password so I can install programs remotely on my android via Google Play Store.

So i searched the web and came into this great weblog.

The mentioned code had problems running, so I've changed it a little bit and I am putting it here for you!

look for "You should only edit these values" and change ???? into appropriate values.

save it into an .vbs file and then run
 
%windir%\SysWoW64\cmd.exe
cscript your file name.vbs 


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Declare Variables & Objects
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Dim oShell
Dim oAutoIt

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Initialise Variables & Objects
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Set oShell = WScript.CreateObject("WScript.Shell")
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")

WScript.Echo "This script will reset your google password 100 times so you can use an old password."

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' You should only edit these values
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

sUN = "myemail@gmail.com" ' Your Google username (email address)
curPW = "?????????" ' Replace with the Current password to your google account
oldPW = "?????????" ' Replace with the final password you want assigned to the account. The one you want to set the account's password *back to*. 

' If your password has a quote in it ("), then use "" in its place.
' For example, let's say your password was 
' MyPass"word!-55
'
' The proper VBScript way to put that into a variable would look like this
' curPW = "MyPass""word!-55"
'
' See Microsoft's website for more detail

' An easy way to find this is to right click the Chrome shortcut and copy the value in Target.
' Click Start, type Chrome, right click Google Chrome, click Properties, copy *everything* in Target, and put it here.
ChromeEXE = "C:\Users\??????\AppData\Local\Google\Chrome\Application\chrome.exe" ' Where is the Chrome executable? Replace this with its location.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' You should not have to edit anything after this
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Start of Script
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


'Some of this code uses the AutoIT com object. See their documentation for more details.

oShell.Run ChromeEXE, 1, False

' Wait for the Notepad window to become active
oAutoIt.WinWaitActive "New Tab - Google Chrome", ""
oAutoIt.Sleep 4000

WScript.Echo "Entering Loop"
' Enter the loop, change the password 99 more times
tCurPw = curPW

    oAutoIt.Send "!d"
    oAutoIt.Sleep 250    
    oAutoIt.Send "https://accounts.google.com/Login{ENTER}"
    oAutoIt.Sleep 5000


For x = 1 To 99
    WScript.Echo "Step " & x
    WScript.Echo "Current PW: " & tCurPw
    tNewPW = curPW & x
    WScript.Echo "Setting the password to: " & tNewPW
    
    GLogin sUN, tCurPw
    GEditPW
    oAutoIt.Send tCurPw & "{TAB} {TAB}"
    oAutoIt.Sleep 250
    oAutoIt.Send tNewPW & "{TAB}"
    oAutoIt.Sleep 250
    oAutoIt.Send tNewPW & "{TAB}"
    oAutoIt.Sleep 250
    oAutoIt.Send "{ENTER}"
    oAutoIt.Sleep 2500
    
    tCurPw = tNewPW

    GLogout
Next 

WScript.Echo "Final Change"
GLogin sUN, tCurPw
GEditPW

oAutoIt.Send tCurPw & "{TAB}"
oAutoIt.Sleep 250
oAutoIt.Send oldPW & "{TAB}"
oAutoIt.Sleep 250
oAutoIt.Send oldPW & "{TAB}"
oAutoIt.Sleep 250
oAutoIt.Send "{ENTER}"
oAutoIt.Send "https://www.google.com/accounts/Logout{ENTER}"
oAutoIt.Sleep 4000
WScript.Echo "Password reset"




WScript.Quit

Function GLogin(un, pw) ' Opens the Google Login page, enters the supplied Username (un) and Password (pw), and presses Enter.
    WScript.Echo "Logging in: " & un & ", " & pw
    'oAutoIt.Send "!d"
    'oAutoIt.Sleep 550    
    'oAutoIt.Send "https://accounts.google.com/Login{ENTER}"
    'oAutoIt.Sleep 4000
    oAutoIt.Send un & "{TAB}"
    oAutoIt.Send pw & "{ENTER}"
    oAutoIt.Sleep 5000

End Function

Function GEditPW() ' Opens the Google Change Password web page
    oAutoIt.Send "!d"
    oAutoIt.Send "!d"
    oAutoIt.Sleep 250
    oAutoIt.Send "https://accounts.google.com/b/0/EditPasswd{ENTER}"
    oAutoIt.Sleep 3000
End Function

Function GLogout() ' Logs out from google. This is necessary for the password change to take effect. Trust me, I tried to do it without logging out. No luck.
    WScript.Echo "Logging out"
    oAutoIt.Send "!d"
    oAutoIt.Send "!d"
    oAutoIt.Sleep 250
    oAutoIt.Send "https://www.google.com/accounts/Logout{ENTER}"
    oAutoIt.Sleep 3000

End Function

16 comments:

  1. Hi! I'm the author of the this script. What did you have to change to get it running?

    ReplyDelete
  2. I dont remember. Lets diff it and see. I think some url changes and some more delays and some changes to number of keys sent to webpage.

    ReplyDelete
  3. This is an informative blog by which I have got that info which I really wanted to get.

    Gmail Technical Support

    ReplyDelete
  4. Hi roozbeh , Contact me esmodev@gmail.com , i have something in mind we can both use and maybe a profit.

    ReplyDelete
  5. Can you change it to work with the new layout please?

    ReplyDelete
  6. Needed this functionality but on a non-Windows machine. Put together a Selenium-based script that does essentially same thing - changes Google password more than 100 times to purge password history. Also updated the selectors to match the state of Google's pages as of July 2016.

    ReplyDelete
  7. Needed this functionality but on a non-Windows machine. Put together a Selenium-based script that does essentially same thing - changes Google password more than 100 times to purge password history. Also updated the selectors to match the state of Google's pages as of July 2016.

    GitHub Repo: https://github.com/dvdotsenko/google_account_password_history_reset

    ReplyDelete
  8. Valuabel info, call at Gmail Technical Support Phone Number Usa 1-888-582-4887 For American Gmail user is available all the time to fix all email related issues. Our technical experts not only fix Gmail issue but guide you how to secure your Gmail account also.

    ReplyDelete
  9. HELP im confused on

    %windir%\SysWoW64\cmd.exe
    cscript your file name.vbs
    what do i do for "cscript your file name.vbs"? thanks

    ReplyDelete
  10. Thank you for taking because Nice knowledge gaining article. This post is really the best on this valuable topic. User can read more on How to Change Outlook Password related problems.

    ReplyDelete
  11. If you need to manage Gmail subscriptions then in that case go to “settings” further click the option “label” then click the option “create a new label” If you still need more information then ask for it from the team of trained and certified experts.
    Gmail Helpline Number UK

    ReplyDelete
  12. In order to resolve the server error first of all get all the cache and cookies cleared from the system also check if your browser has any virus or if there are any updates to be added to the browser also get the browser extensions disabled also get the Gmail lab disabled. If you still need more information then ask for it from the experts.
    Gmail Login Issues
    Gmail My Account

    ReplyDelete