Je souhaite retrouver le mot de passe d'une de mes sauvegardes effectuées avec le logiciel Drive snapshot.
J'ai pour cela un fichier texte avec la liste de mes mots de passe habituels (password.txt) et le script suivant:
Code : Tout sélectionner
; Wait Snapshot
$WinTitle = "[TITLE:Snapshot - Enter Password]"
WinWaitActive($WinTitle)
; Open password file
$file = FileOpen("c:\password.txt", 0)
; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf
; Read in lines of text until the EOF is reached
While 1
$line = String(FileReadLine($file))
If @error = -1 Then ExitLoop
ControlSend($WinTitle, "", "[CLASS:Edit; INSTANCE:1]", $line)
ControlClick($WinTitle, "", "[CLASS:Button; TEXT:OK; INSTANCE:1]")
; Test notepad
ControlSend("[TITLE:Sans titre - Bloc-notes; CLASS:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", $line)
ControlSend("[TITLE:Sans titre - Bloc-notes; CLASS:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "{ENTER}")
Sleep(250)
If $line == "exit" Then ExitLoop
Wend
FileClose($file)
; Finished!
Code : Tout sélectionner
ControlSend("[TITLE:Snapshot - Enter Password]", "", "[CLASS:Edit; INSTANCE:1]", "mot de passe")Mais avec le bloc note pas de problème:
Code : Tout sélectionner
ControlSend("[TITLE:Sans titre - Bloc-notes; CLASS:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "mot de passe")Code : Tout sélectionner
ControlSend("[TITLE:Unknow - Bloc-notes; CLASS:Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "mot de passe")
